<div dir="ltr">Hello Reinier,<div><br></div><div>check out repos/os/src/test/trace/main.cc</div><div>This test shows how to get trace subject information including untraced subjects. Specifically, look at line 215+ (on Genode 15.11).</div><div><br></div><div>The full diff for my Fiasco.OC execution time patch is the following. I'll submit a pull request for it soon.</div><div><br></div><div><div style="font-size:12.8px"><div style="font-size:12.8px"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">diff --git a/repos/base-foc/src/core/include/platform_thread.h b/repos/base-foc/src/core/include/platform_thread.h<br>index 62bce14..b33b0a5 100644<br>--- a/repos/base-foc/src/core/include/platform_thread.h<br>+++ b/repos/base-foc/src/core/include/platform_thread.h<br>@@ -175,7 +175,7 @@ namespace Genode {<br> <span style="white-space:pre-wrap">                       </span>/**<br> <span style="white-space:pre-wrap">                 </span> * Return <span class="">execution</span> <span class="">time</span> consumed by the thread<br> <span style="white-space:pre-wrap">                 </span> */<br>-<span style="white-space:pre-wrap">                 </span>unsigned long long execution_time() const { return 0; }<br>+<span style="white-space:pre-wrap">                      </span>unsigned long long execution_time() const;<br> <br> <br> <span style="white-space:pre-wrap">                  </span>/*******************************<br>diff --git a/repos/base-foc/src/core/platform_thread.cc b/repos/base-foc/src/core/platform_thread.cc<br>index 92d4a54..ef388af 100644<br>--- a/repos/base-foc/src/core/platform_thread.cc<br>+++ b/repos/base-foc/src/core/platform_thread.cc<br>@@ -266,6 +266,19 @@ Weak_ptr<Address_space> Platform_thread::address_space()<br> }<br> <br> <br>+unsigned long long Platform_thread::execution_<span class="">time</span>() const<br>+{<br>+<span style="white-space:pre-wrap">     </span>unsigned long long <span class="">time</span> = 0;<br>+<br>+<span style="white-space:pre-wrap">        </span>if (_utcb) {<br>+<span style="white-space:pre-wrap">         </span>l4_thread_stats_time(_thread.local.dst());<br>+<span style="white-space:pre-wrap">           </span><span class="">time</span> = *(l4_kernel_clock_t*)&l4_utcb_mr()->mr[0];<br>+<span style="white-space:pre-wrap">        </span>}<br>+<br>+<span style="white-space:pre-wrap"> </span>return <span class="">time</span>;<br>+}<br>+<br>+<br> Platform_thread::Platform_thread(const char *name, unsigned prio, addr_t)<br> : _state(DEAD),<br>   _core_thread(false),</blockquote><div><br></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 19 April 2016 at 06:00, Reinier Millo Sánchez <span dir="ltr"><<a href="mailto:rmillo@...210..." target="_blank">rmillo@...210...</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Hi Georg<br>
    <br>
    I'm trying to use your implementation of execution_time on GenodeOS
    for base-foc.<br>
    I want to measure the execution time of an application inside itself
    at certain points to make some benchmarks. I'm reviewing how to call
    the function within the same application in which I want to measure
    time, but I don't have found way to do it.<br>
    If you can help me or recomend me some references.<br>
    <br>
    Best regards<div><div class="h5"><br>
    <br>
    <br>
    <br>
    <div>On 02/23/2016 04:20 AM, Georg Guba
      wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">Hello Stefan,
        <div><br>
        </div>
        <div>oh wow. What a beginner's mistake. Thank you. Of course I
          cast the message register wrong (missing a & there). It
          seems to be working now:</div>
        <div><br>
        </div>
        <div>time = *(l4_kernel_clock_t*)&l4_utcb_mr()->mr[0];<br>
        </div>
        <div><br>
        </div>
        <div>Thanks a lot.</div>
        <div><br>
        </div>
        <div>Best regards,</div>
        <div>Georg</div>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">On 23 February 2016 at 09:53, Stefan
            Kalkowski <span dir="ltr"><<a href="mailto:stefan.kalkowski@...1..." target="_blank">stefan.kalkowski@...1...</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hello
              Georg,<br>
              <div>
                <div><br>
                  On 02/22/2016 06:38 PM, Georg Guba wrote:<br>
                  > I'm trying to implement
                  Platform_thread::execution_time() for Fiasco.OC.<br>
                  > However, when using the code below, I'm getting a
                  null pointer error when<br>
                  > trying to read the UTCB's message register:<br>
                  ><br>
                  > Possible null pointer READ at 0 IP 704c0d7c<br>
                  ><br>
                  > unsigned long long
                  Platform_thread::execution_time() const<br>
                  > {<br>
                  > unsigned long long time = 0;<br>
                  ><br>
                  > if (_utcb)<br>
                  > {<br>
                  > l4_thread_stats_time(_thread.local.dst());<br>
                  > time =
                  *(l4_kernel_clock_t*)l4_utcb_mr()->mr[0];<br>
                  > }<br>
                  ><br>
                  > return time;<br>
                  > }<br>
                  ><br>
                  > The doc for l4_thread_stats_time(...) says<br>
                  ><br>
                  > /**<br>
                  > * \brief Get consumed timed of thread in µs.<br>
                  > * \ingroup l4_thread_api<br>
                  > * \param thread Thread to get the consumed time
                  from.<br>
                  > *<br>
                  > * The consumed time is returned as
                  l4_kernel_clock_t at UTCB message<br>
                  > * register 0.<br>
                  > */<br>
                  > L4_INLINE l4_msgtag_t<br>
                  > l4_thread_stats_time(l4_cap_idx_t thread)
                  L4_NOTHROW;<br>
                  ><br>
                  > So my usage should be about right.<br>
                  > What am I missing?<br>
                  <br>
                </div>
              </div>
              although, this is a bit off-topic and I did not used the
              mentioned<br>
              kernel feature till now (you might refer to the l4-hackers
              mailing-list<br>
              when having further questions regarding Fiasco.OC and
              L4Re), I'll try to<br>
              help you.<br>
              <br>
              It seems you expected a pointer in the UTCB to the time
              structure, but<br>
              it is surely a value (the kernel wouldn't know where to
              deposit the<br>
              value aside of the UTCB, it doesn't do memory allocations
              on behalf of<br>
              user tasks).<br>
              <br>
              When searching for the right usage of
              "l4_thread_stats_time", I came<br>
              across this post on the l4-hackers mailinglist:<br>
              <a href="http://os.inf.tu-dresden.de/pipermail/l4-hackers/2012/005419.html" rel="noreferrer" target="_blank">http://os.inf.tu-dresden.de/pipermail/l4-hackers/2012/005419.html</a><br>
              <br>
              I hope it helps.<br>
              <br>
              Regards<br>
              Stefan<br>
              <br>
              ><br>
              ><br>
              ><br>
              >
------------------------------------------------------------------------------<br>
              > Site24x7 APM Insight: Get Deep Visibility into
              Application Performance<br>
              > APM + Mobile APM + RUM: Monitor 3 App instances at
              just $35/Month<br>
              > Monitor end-to-end web transactions and take
              corrective actions now<br>
              > Troubleshoot faster and improve end-user experience.
              Signup Now!<br>
              > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140" rel="noreferrer" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140</a><br>
              ><br>
              ><br>
              ><br>
              > _______________________________________________<br>
              > genode-main mailing list<br>
              > <a href="mailto:genode-main@lists.sourceforge.net" target="_blank">genode-main@lists.sourceforge.net</a><br>
              > <a href="https://lists.sourceforge.net/lists/listinfo/genode-main" rel="noreferrer" target="_blank">https://lists.sourceforge.net/lists/listinfo/genode-main</a><br>
              ><br>
              <br>
              --<br>
              Stefan Kalkowski<br>
              Genode Labs<br>
              <br>
              <a href="http://www.genode-labs.com/" rel="noreferrer" target="_blank">http://www.genode-labs.com/</a> · <a href="http://genode.org/" rel="noreferrer" target="_blank"></a><a href="http://genode.org/" target="_blank">http://genode.org/</a><br>
              <br>
------------------------------------------------------------------------------<br>
              Site24x7 APM Insight: Get Deep Visibility into Application
              Performance<br>
              APM + Mobile APM + RUM: Monitor 3 App instances at just
              $35/Month<br>
              Monitor end-to-end web transactions and take corrective
              actions now<br>
              Troubleshoot faster and improve end-user experience.
              Signup Now!<br>
              <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140" rel="noreferrer" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140</a><br>
              _______________________________________________<br>
              genode-main mailing list<br>
              <a href="mailto:genode-main@lists.sourceforge.net" target="_blank">genode-main@lists.sourceforge.net</a><br>
              <a href="https://lists.sourceforge.net/lists/listinfo/genode-main" rel="noreferrer" target="_blank">https://lists.sourceforge.net/lists/listinfo/genode-main</a><br>
            </blockquote>
          </div>
          <br>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
<a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140</a></pre>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
genode-main mailing list
<a href="mailto:genode-main@lists.sourceforge.net" target="_blank">genode-main@lists.sourceforge.net</a>
<a href="https://lists.sourceforge.net/lists/listinfo/genode-main" target="_blank">https://lists.sourceforge.net/lists/listinfo/genode-main</a>
</pre>
    </blockquote>
    <br>
    </div></div><pre cols="72">-- 
Lic. Reinier Millo Sánchez
Centro de Estudios de Informática
Universidad Central "Marta Abreu" de Las Villas
Carretera a Camajuaní Km 5 1/2
Santa Clara, Villa Clara, Cuba
CP 54830

"antes de discutir ... respira;
  antes de hablar ... escucha;
 antes de escribir ... piensa;
  antes de herir ... siente;
 antes de rendirte ... intenta;
  antes de morir ... vive"
</pre>
  </div>

<br>------------------------------------------------------------------------------<br>
Find and fix application performance issues faster with Applications Manager<br>
Applications Manager provides deep performance insights into multiple tiers of<br>
your business applications. It resolves application problems quickly and<br>
reduces your MTTR. Get your free trial!<br>
<a href="https://ad.doubleclick.net/ddm/clk/302982198;130105516;z" rel="noreferrer" target="_blank">https://ad.doubleclick.net/ddm/clk/302982198;130105516;z</a><br>_______________________________________________<br>
genode-main mailing list<br>
<a href="mailto:genode-main@lists.sourceforge.net">genode-main@...12...ceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/genode-main" rel="noreferrer" target="_blank">https://lists.sourceforge.net/lists/listinfo/genode-main</a><br>
<br></blockquote></div><br></div>