<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body 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<br>
<br>
<br>
<br>
<div class="moz-cite-prefix">On 02/23/2016 04:20 AM, Georg Guba
wrote:<br>
</div>
<blockquote
cite="mid:CAGKi--mBu+-kO8a5SossAUfbUrxYLVAL3HstBbPmiFfRHSSkdg@...3..."
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 moz-do-not-send="true"
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 class="h5"><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 moz-do-not-send="true"
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 moz-do-not-send="true"
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 moz-do-not-send="true"
href="mailto:genode-main@lists.sourceforge.net">genode-main@lists.sourceforge.net</a><br>
> <a moz-do-not-send="true"
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 moz-do-not-send="true"
href="http://www.genode-labs.com/" rel="noreferrer"
target="_blank">http://www.genode-labs.com/</a> · <a
moz-do-not-send="true" href="http://genode.org/"
rel="noreferrer" target="_blank"><a class="moz-txt-link-freetext" href="http://genode.org/">http://genode.org/</a></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 moz-do-not-send="true"
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 moz-do-not-send="true"
href="mailto:genode-main@lists.sourceforge.net">genode-main@lists.sourceforge.net</a><br>
<a moz-do-not-send="true"
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 class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">------------------------------------------------------------------------------
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 class="moz-txt-link-freetext" href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140</a></pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
genode-main mailing list
<a class="moz-txt-link-abbreviated" href="mailto:genode-main@lists.sourceforge.net">genode-main@lists.sourceforge.net</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/genode-main">https://lists.sourceforge.net/lists/listinfo/genode-main</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" 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>
</body>
</html>