Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: compudj@krystal.dyndns.org (Mathieu Desnoyers)
Subject: [ltt-dev] trace_clock_update() spinning
Date: Tue, 2 Feb 2010 14:42:28 -0500	[thread overview]
Message-ID: <20100202194228.GA24026@Krystal> (raw)
In-Reply-To: <4B3F8896E1733D4787DDB0EA1C7FF91F0108CDD1@ukmail.uk.wirelessworld.airvananet.com>

Hi Mike,

The answer to your question is in the LTTng Manual, "Supported
architectures"

http://lttng.org/cgi-bin/gitweb.cgi?p=lttv.git;a=blob_plain;f=LTTngManual.html

it states that "Other ARM (with limited timestamping precision, e.g.
1HZ. Need architecture-specific support for better precision)"

So it's not that LTTng itself is taking time, but that the trace clock
resolution available for your architecture is really coarse. You could
possibly get a better resolution by creating a trace clock specific for
your architecture.

Mathieu

* Mike McTernan (mmcternan at airvana.com) wrote:
> Hi,
> 
> I'm using Linux 2.6.28.2 + LTTng 0.88 on an ARM Freescale i.MX51 board.
> 
> 
> The system works quite well - in fact LTTng is awesome!  But there's a
> problem that the output in LTTV shows run_timer_softirq() taking almost
> all the time between timer ticks.  HZ is set to 100 so the timer IRQ
> runs every 10ms, with run_timer_softirq() typically taking about 9.8ms
> as measured in LTTV.
> 
> I added some trace_mark() calls to find the consumer of this time to be
> trace_clock_update().  Specifically the atomic update:
> 
>   n = 0;
>   
>   do {
>     n++;
>     
>     old_clock = atomic_long_read(&trace_clock);
>     new_clock = (old_clock + (ticks << TRACE_CLOCK_SHIFT))
>       & (~((1 << TRACE_CLOCK_SHIFT) - 1));             
>   } while (atomic_long_cmpxchg(&trace_clock, old_clock, new_clock)
>              != old_clock);
> 
>   trace_mark(trace_clock_update, exit, "exit %u", n);
> 
> This never appears to loop as the "exit" value I added is always 1.
> However I notice that on ARM atomic_long_cmpxchg() contains a loop, and
> so is presumably racing around in there.
> 
> I'm not sure if this something completely unexpected, or normal
> behaviour?  Looking through the code I can't see that trace_clock is
> updated in many cases, although my grep maybe off.  I wondered if the
> ARM atomic_long_cmpxchg() is broken, but didn't find much there either.
> 
> Since I'm on a uniprocessor system, could I safely modify the update
> function to just atomically update the trace_clock without using the
> cmpxchg() operation since it's called in the soft IRQ?
>  
> Regards,
> 
> Mike
> 
> 
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> 

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68




  reply	other threads:[~2010-02-02 19:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-02 18:52 Mike McTernan
2010-02-02 19:42 ` Mathieu Desnoyers [this message]
2010-02-02 21:12   ` Mike McTernan
2010-02-05  9:37   ` Mike McTernan
2010-02-05 15:16     ` Mathieu Desnoyers
2010-02-05 15:48       ` Josh Boyer
2010-02-05 15:57         ` Mathieu Desnoyers
2010-02-05 17:27       ` Mike McTernan
2010-02-09  0:30         ` Mathieu Desnoyers
2010-02-09 10:19           ` Mike McTernan
2010-02-09 14:42             ` Mathieu Desnoyers

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=20100202194228.GA24026@Krystal \
    --to=compudj@krystal.dyndns.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