public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <srostedt@redhat.com>
To: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: ftrace bad timings (was: No Subject)
Date: Tue, 19 Aug 2008 19:13:12 -0400	[thread overview]
Message-ID: <48AB5388.5050106@redhat.com> (raw)
In-Reply-To: <20080819225426.GA11464@Krystal>

Mathieu Desnoyers wrote:
> Hi Steven,
>
> I am currently trying to get precise numbers on the interrupt latency
> generated by a heavy load on my new writer-biased rwlock (previously
> known as fair rwlock).
>
> However, when trying to use the irqoff tracer, I hit this :
>
> # tracer: irqsoff
> #
> irqsoff latency trace v1.1.5 on 2.6.27-rc3-trace
> --------------------------------------------------------------------
>  latency: 3995 us, #3/3, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:8)
>     -----------------
>     | task: swapper-0 (uid:0 nice:0 policy:0 rt_prio:0)
>     -----------------
>  => started at: apic_timer_interrupt
>  => ended at:   __do_softirq
>
> #                _------=> CPU#            
> #               / _-----=> irqs-off        
> #              | / _----=> need-resched    
> #              || / _---=> hardirq/softirq 
> #              ||| / _--=> preempt-depth   
> #              |||| /                      
> #              |||||     delay             
> #  cmd     pid ||||| time  |   caller      
> #     \   /    |||||   \   |   /           
>   <idle>-0     0d..1    0us!: trace_hardirqs_off_thunk (apic_timer_interrupt)
>   <idle>-0     0d.s2 3995us+: __do_softirq (0)
>   <idle>-0     0d.s3 3997us : trace_hardirqs_on (__do_softirq)
>
> Is it known/does it have a solution ? I would really like to be able to
> see sub 4ms numbers....
>
>
>   

Could you go into kernel/trace/trace.c and search for ftrace_now. Then 
change cpu_clock to sched_clock. cpu_clock is known to give large 
inaccurate timings and is not reliable with ftrace. Unfortunately, 
sched_clock can be bad on various hardware, but should always be fine 
for preempt and irqs off latency timings since that is always local to a 
single CPU.

-- Steve


  reply	other threads:[~2008-08-19 23:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-19 22:54 Mathieu Desnoyers
2008-08-19 23:13 ` Steven Rostedt [this message]
2008-08-20  6:43   ` ftrace bad timings 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=48AB5388.5050106@redhat.com \
    --to=srostedt@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.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