public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: John Sigler <linux.kernel@free.fr>
Cc: linux-rt-users@vger.kernel.org,
	oprofile-list@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: Pin-pointing the root of unusual application latencies
Date: Mon, 23 Jul 2007 18:04:42 +0200	[thread overview]
Message-ID: <20070723160442.GA7995@elte.hu> (raw)
In-Reply-To: <46A4B7C2.1070304@free.fr>


* John Sigler <linux.kernel@free.fr> wrote:

> > ./trace-it 1 > trace.txt
> >
> > does it produce lots of trace entries? If not then 
> > CONFIG_FUNCTION_TRACING is not enabled. Once you see lots of output 
> > in the file, the tracer is up and running and you can start tracing 
> > the latency in your app.
> 
> # ./trace-it 1 >/tmp/trace.txt
> # wc /tmp/trace.txt
>   65555  393277 4096317 /tmp/trace.txt
> 
> preemption latency trace v1.1.5 on 2.6.20.7-rt8

>    <...>-939   0D...    0us : read_tsc (get_monotonic_cycles)

add 'notrace' to the definition of read_tsc in arch/i386/kernel/tsc.c. 
(check recent -rt's read_tsc() definition) (or do echo 1 > 
/proc/sys/kernel/trace_use_raw_cycles - if you are using recent enough 
-rt)

> >To track it down, use the method that trace-it.c uses to start/stop 
> >tracing, i.e. put the prctl(0,1); / prctl(0,0); calls into your app 
> >to start/stop tracing and the kernel will do the rest once you've set 
> >/proc/sys/kernel/preempt_max_latency back to 0: /proc/latency_trace 
> >will always contain the longest latency that your app triggered, of 
> >the critical path you programmed into it.
> 
> Here's what I came up with:
> http://linux.kernel.free.fr/latency/check_dektec_input3.cxx
> (I enable tracing only 1% of the time.)
> 
> The output looks very much like the one I got when I ran trace-it

> 1. Again, shouldn't there be other functions in the output?

there should be, once you fix read_tsc().

> 2. How much overhead do the prctl calls incur? Is it possible that 
> they are somehow masking my problem? (I'll let the program run all 
> night to maximize the chances of capturing the anomalous latency.)

it's not the prctl calls that matter but the fact that every kernel 
function will be traced if you have FUNCTION_TRACING on. It mask any 
races - but latencies are usually not masked (they are enlarged).

	Ingo

  reply	other threads:[~2007-07-23 16:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <469600F7.3060603@free.fr>
2007-07-23  9:53 ` Pin-pointing the root of unusual application latencies Ingo Molnar
2007-07-23 14:14   ` John Sigler
2007-07-23 16:04     ` Ingo Molnar [this message]
2007-07-23 16:44       ` John Sigler
2007-07-24  8:31       ` John Sigler
2007-07-24  9:20         ` John Sigler
2007-07-25 13:04         ` John Sigler
2007-07-25 13:05           ` Ingo Molnar
2007-07-25 13:20             ` John Sigler
2007-07-25 13:38               ` Ingo Molnar
2007-07-25 14:05                 ` John Sigler
2007-07-25 15:28                   ` Karsten Wiese
2007-07-25 15:46                     ` John Sigler
2007-07-25 16:31                       ` Karsten Wiese
2007-07-25 17:09                   ` Len Brown
2007-07-26  8:35                     ` John Sigler
2007-07-26 10:45                       ` John Sigler
2007-07-26 12:02                         ` John Sigler
2007-07-26 15:16         ` John Sigler

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=20070723160442.GA7995@elte.hu \
    --to=mingo@elte.hu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=linux.kernel@free.fr \
    --cc=oprofile-list@lists.sourceforge.net \
    /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