Hi Georg
I'm trying to use your implementation of execution_time on GenodeOS for base-foc. 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. If you can help me or recomend me some references.
Best regards
On 02/23/2016 04:20 AM, Georg Guba wrote:
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... mailto: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 <mailto: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 <mailto:genode-main@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/genode-main
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