Fiasco.OC thread execution time

Georg Guba georgguba at ...9...
Tue Feb 23 10:20:12 CET 2016


Hello Stefan,

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:

time = *(l4_kernel_clock_t*)&l4_utcb_mr()->mr[0];

Thanks a lot.

Best regards,
Georg

On 23 February 2016 at 09:53, Stefan Kalkowski <
stefan.kalkowski at ...1...> wrote:

> Hello Georg,
>
> On 02/22/2016 06:38 PM, Georg Guba wrote:
> > I'm trying to implement Platform_thread::execution_time() for Fiasco.OC.
> > However, when using the code below, I'm getting a null pointer error when
> > trying to read the UTCB's message register:
> >
> > Possible null pointer READ at 0 IP 704c0d7c
> >
> > unsigned long long Platform_thread::execution_time() const
> > {
> > unsigned long long time = 0;
> >
> > if (_utcb)
> > {
> > l4_thread_stats_time(_thread.local.dst());
> > time = *(l4_kernel_clock_t*)l4_utcb_mr()->mr[0];
> > }
> >
> > return time;
> > }
> >
> > The doc for l4_thread_stats_time(...) says
> >
> > /**
> > * \brief Get consumed timed of thread in µs.
> > * \ingroup l4_thread_api
> > * \param thread Thread to get the consumed time from.
> > *
> > * The consumed time is returned as l4_kernel_clock_t at UTCB message
> > * register 0.
> > */
> > L4_INLINE l4_msgtag_t
> > l4_thread_stats_time(l4_cap_idx_t thread) L4_NOTHROW;
> >
> > So my usage should be about right.
> > What am I missing?
>
> although, this is a bit off-topic and I did not used the mentioned
> kernel feature till now (you might refer to the l4-hackers mailing-list
> when having further questions regarding Fiasco.OC and L4Re), I'll try to
> help you.
>
> It seems you expected a pointer in the UTCB to the time structure, but
> it is surely a value (the kernel wouldn't know where to deposit the
> value aside of the UTCB, it doesn't do memory allocations on behalf of
> user tasks).
>
> When searching for the right usage of "l4_thread_stats_time", I came
> across this post on the l4-hackers mailinglist:
> http://os.inf.tu-dresden.de/pipermail/l4-hackers/2012/005419.html
>
> I hope it helps.
>
> Regards
> Stefan
>
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > 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!
> > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> >
> >
> >
> > _______________________________________________
> > genode-main mailing list
> > genode-main at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/genode-main
> >
>
> --
> Stefan Kalkowski
> Genode Labs
>
> http://www.genode-labs.com/ · http://genode.org/
>
>
> ------------------------------------------------------------------------------
> 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!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> _______________________________________________
> genode-main mailing list
> genode-main at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/genode-main
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genode.org/pipermail/users/attachments/20160223/addb3b8d/attachment.html>


More information about the users mailing list