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@...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@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@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main