From: michi1@michaelblizek.twilightparadox.com (michi1 at michaelblizek.twilightparadox.com)
To: kernelnewbies@lists.kernelnewbies.org
Subject: How to measure performance inside Kernel?
Date: Sat, 11 Feb 2012 08:22:33 +0100 [thread overview]
Message-ID: <20120211072232.GA2232@grml> (raw)
In-Reply-To: <CA+MoWDqXn=fS_Wf+vsvYH40MufaN7GTBW2MogaE8GMwUz6=fPg@mail.gmail.com>
Hi!
On 19:47 Fri 10 Feb , Peter Senna Tschudin wrote:
...
> #include <linux/time.h>
>
> getnstimeofday (ts_start); /*stopwatch start*/
...
> getnstimeofday (ts_end); /*stopwatch stop*/
>
> diff = timespec_sub(end, begin);
>
> printk ("%lu,", diff.tv_nsec );
>
> Am I doing anything wrong? Can mysterious stuff like out of order
> execution engine, brake the stopwatch?
Why don't you print the tv_sec part?
You might also want to replace getnstimeofday with getrawmonotonic or any
other monotonic time source. If ntp or something else decides to change system
time during the measurement, you would probably get weird results.
-Michi
--
programing a layer 3+4 network protocol for mesh networks
see http://michaelblizek.twilightparadox.com
next prev parent reply other threads:[~2012-02-11 7:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-09 12:58 How to measure performance inside Kernel? Peter Senna Tschudin
2012-02-09 18:12 ` michi1 at michaelblizek.twilightparadox.com
2012-02-10 21:47 ` Peter Senna Tschudin
2012-02-10 22:06 ` Jeff Haran
2012-02-11 0:22 ` Peter Senna Tschudin
2012-02-11 3:44 ` Graeme Russ
2012-02-11 13:14 ` Peter Senna Tschudin
2012-02-11 13:57 ` Peter Senna Tschudin
2012-02-12 11:46 ` Mulyadi Santosa
2012-02-13 23:13 ` Peter Senna Tschudin
2012-02-14 3:43 ` Mulyadi Santosa
2012-02-11 7:34 ` michi1 at michaelblizek.twilightparadox.com
2012-02-11 7:22 ` michi1 at michaelblizek.twilightparadox.com [this message]
2012-02-11 13:29 ` Peter Senna Tschudin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120211072232.GA2232@grml \
--to=michi1@michaelblizek.twilightparadox.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).