public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] tracing/function-graph-tracer: use the more lightweight local clock
Date: Thu, 5 Mar 2009 11:56:52 +0100	[thread overview]
Message-ID: <20090305105652.GG32407@elte.hu> (raw)
In-Reply-To: <20090305084639.GC5359@nowhere>


* Frederic Weisbecker <fweisbec@gmail.com> wrote:

> On Thu, Mar 05, 2009 at 08:30:13AM +0100, Peter Zijlstra wrote:
> > On Thu, 2009-03-05 at 02:19 +0100, Frederic Weisbecker wrote:
> > 
> > > It takes 1 ms to execute while tracing.
> > > Considering my frequency is 250 Hz, it means 1/4 of the system is used
> > > on timer interrupt while tracing.
> > > 
> > > For now the hang is fixed, but not the awful latency. And I'm just too frightened
> > > to test it on 1000 Hz.
> > > 
> > > But I plan to add a kind of watchdog to check how many time we spent inside an
> > > interrupt while graph tracing.
> > > By checking this time against the current Hz value, I could decide to abort the tracing
> > > for all irq.
> > 
> > That would basically render the thing useless :-(
> 
> 
> It would be only for slow machines :-)
> I'm talking about something that happened on a Pentium II.
> 
>  
> > Is it specifically function_graph that is so expensive? If so, is that
> > because of the function exit hook?
> 
> 
> Yes, specifically the function_graph, the function tracer is 
> not concerned. The function graph tracer takes more than 
> double overhead compared to the function tracer.
> 
> Usually the function tracer hooks directly the the function 
> that insert the event, it's pretty straightforward.
> 
> The function graph does much more work: 
> 
> entry: basic checks, take the time, push the infos on the stack, insert an event
>        on the ring-buffer, hook the return value.
> return: pop the infos from stack, insert an event on the ring-buffer, jump
>         to the original caller.
> 
> It has a high cost... which makes me sad because I plan to 
> port it in on Arm and I fear the little Arm boad I recently 
> purshased will not let me trace the interrupts without 
> hanging...
> :-(
> 
> I guess I should start thinking on some optimizations, perhaps 
> using perfcounter?

yeah. perfcounters and KernelTop might not work on a PII CPU out 
of box though.

But hacking perfcounters and looking at perfstat/kerneltop 
output is serious amount of fun so if you are interested you 
could try to implement support for it. Do you have any box where 
perfcounters work? (that would be Core2 Intel boxes or pretty 
much any AMD box)

You could have a look at how oprofile works on your box - the 
code for PII CPUs should be in 
arch/x86/oprofile/op_model_ppro.c.

There's also hardcoded support for a single perfcounter in the 
nmi_watchdog=2 code, in arch/x86/kernel/cpu/perfctr-watchdog.c, 
for pretty much any x86 CPU that has a PMU.

Plus there's also the CPU documentation on Intel's site. It's 
quite well written and pretty well structured. The URL for the 
CPU's PMU ("Performance Monitoring") should be:

  http://download.intel.com/design/processor/manuals/253669.pdf

As a last resort ;-)

	Ingo

  reply	other threads:[~2009-03-05 10:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-05  0:49 [PATCH 2/2] tracing/function-graph-tracer: use the more lightweight local clock Frederic Weisbecker
2009-03-05  1:19 ` Frederic Weisbecker
2009-03-05  7:30   ` Peter Zijlstra
2009-03-05  8:46     ` Frederic Weisbecker
2009-03-05 10:56       ` Ingo Molnar [this message]
2009-03-05 11:16         ` Frederic Weisbecker
2009-03-05 11:56           ` Ingo Molnar
2009-03-05 14:01             ` Frederic Weisbecker
2009-03-05 14:22               ` Ingo Molnar
2009-03-05 11:03 ` [tip:tracing/function-graph-tracer] " Frederic Weisbecker
2009-03-05 11:04 ` [PATCH 2/2] " Ingo Molnar
2009-03-05 11:23   ` Frederic Weisbecker
2009-03-05 11:38     ` Ingo Molnar
2009-03-05 11:18 ` [tip:tracing/function-graph-tracer] " Frederic Weisbecker

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=20090305105652.GG32407@elte.hu \
    --to=mingo@elte.hu \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --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