[lkml]   [2007]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Pin-pointing the root of unusual application latencies

* John Sigler <> 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

> <...>-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

> >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:
> (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).

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-07-23 18:11    [W:0.070 / U:3.776 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site