public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Jason Baron <jbaron@redhat.com>,
	mingo@elte.hu, rostedt@goodmis.org, linux-kernel@vger.kernel.org,
	acme@ghostprotocols.net, fche@redhat.com,
	compudj@krystal.dyndns.org
Subject: Re: [PATCH] new irq tracer
Date: Thu, 19 Feb 2009 02:46:39 +0100	[thread overview]
Message-ID: <20090219014638.GA5785@nowhere> (raw)
In-Reply-To: <1234991725.4799.1.camel@laptop>

On Wed, Feb 18, 2009 at 10:15:25PM +0100, Peter Zijlstra wrote:
> On Wed, 2009-02-18 at 14:53 -0500, Jason Baron wrote:
> > hi,
> > 
> > Using a copule of tracepoints i've implemented an 'irq tracer' which has
> > the following column format:
> > 
> > [time][irq][action][handled][cpu][length]
> > 
> > for example on my system:
> > 
> > [ 1038.927248381]     28     eth0      1        3     0.000002745
> > [ 1038.927544688]     28     eth0      1        3     0.000002520
> > [ 1038.927593609]     28     eth0      1        3     0.000002509
> > [ 1038.974087675]     29     ahci      1        1     0.000013135
> > [ 1038.974288475]     29     ahci      1        1     0.000005542
> > [ 1038.974414324]     29     ahci      1        1     0.000007953
> > 
> > I think this patch is useful in understanding irq system behavior, and
> > for tracking down irq driver handlers that are firing too often or
> > spending too much time handling an irq. This approach could be extended
> > to the timer irq and for softirqs...
> 
> The function graph tracer can already do this, it has a special section
> to recognize irq entry function, and already measures time spend.


Right, except that it doesn't trace the irq number, action and the return value,
though the latter will be handled one day (probably soon).
 

> I guess with Steve's new triggers (probes or whatever they ended up
> being called) you could limit it to just IRQ entry points.


We already could trace only irq function call tree through set_graph_function:
echo smp_apic_timer_interrupt > set_graph_function
echo do_IRQ >> set_graph_function

But you will see the whole call graph:

  321.913057 |   1)               |      do_IRQ() {
  321.913058 |   1)   0.571 us    |        exit_idle();
  321.913059 |   1)               |        irq_enter() {
  321.913059 |   1)   0.548 us    |          rcu_irq_enter();
  321.913060 |   1)   0.533 us    |          idle_cpu();
  321.913064 |   1)   2.696 us    |        }
  321.913065 |   1)               |        handle_irq() {
  321.913065 |   1)   0.533 us    |          irq_to_desc();
  321.913067 |   1)               |          handle_edge_irq() {
  321.913067 |   1)   0.653 us    |            _spin_lock();
  321.913068 |   1)               |            ack_apic_edge() {
  321.913069 |   1)   0.533 us    |              irq_to_desc();
  321.913070 |   1)               |              move_native_irq() {
  321.913070 |   1)   0.525 us    |                irq_to_desc();
  321.913072 |   1)   1.577 us    |              }
  321.913072 |   1)   0.563 us    |              native_apic_mem_write();
  321.913073 |   1)   4.813 us    |            }
  321.913074 |   1)   0.601 us    |            _spin_unlock();
  321.913075 |   1)               |            handle_IRQ_event() {
  321.913075 |   1)               |              timer_interrupt() {
  321.913076 |   1)               |                tick_handle_oneshot_broadcast() {
  321.913077 |   1)   0.631 us    |                  _spin_lock();
  321.913078 |   1)               |                  ktime_get() {
  321.913078 |   1)               |                    ktime_get_ts() {
  321.913079 |   1)               |                      getnstimeofday() {
  321.913079 |   1)   1.735 us    |                        read_hpet();
  321.913082 |   1)   2.854 us    |                      }
  321.913082 |   1)   0.534 us    |                      set_normalized_timespec();
  321.913083 |   1)   4.963 us    |                    }
  321.913084 |   1)   6.015 us    |                  }
  321.913084 |   1)               |                  tick_do_broadcast() {
  321.913085 |   1)               |                    lapic_timer_broadcast() {
  321.913086 |   1)   0.624 us    |                      flat_send_IPI_mask();
  321.913087 |   1)   1.697 us    |                    }
  321.913087 |   1)   2.944 us    |                  }
  321.913088 |   1)   0.585 us    |                  _spin_unlock();
  321.913089 |   1) + 12.892 us   |                }
  321.913089 |   1) + 14.079 us   |              }
  321.913090 |   1) + 15.176 us   |            }
  321.913091 |   1)   0.540 us    |            note_interrupt();
  321.913092 |   1)   0.653 us    |            _spin_lock();
  321.913093 |   1)   0.586 us    |            _spin_unlock();
  321.913094 |   1) + 27.354 us   |          }
  321.913094 |   1) + 29.547 us   |        }
  321.913095 |   1)               |        irq_exit() {
  321.913096 |   1)   0.526 us    |          rcu_irq_exit();
  321.913097 |   1)   0.526 us    |          idle_cpu();
  321.913098 |   1)   2.674 us    |        }
  321.913098 |   1) + 41.096 us   |      }
  321.913098 |   1)   <========== |

Or you can only trace do_IRQ and smp_apic_timer_interrupt alone without tracing their
call tree:

echo smp_apic_timer_interrupt > set_ftrace_filter
echo do_IRQ >> set_ftrace_filter


      parent reply	other threads:[~2009-02-19  1:46 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-18 19:53 [PATCH] new irq tracer Jason Baron
2009-02-18 20:08 ` Steven Rostedt
2009-02-18 20:26 ` Mathieu Desnoyers
2009-02-19  1:42   ` KOSAKI Motohiro
2009-02-18 20:30 ` Kyle McMartin
2009-02-18 21:15 ` Peter Zijlstra
2009-02-18 21:35   ` Jason Baron
2009-02-18 21:46     ` Peter Zijlstra
2009-02-18 22:02       ` Frank Ch. Eigler
2009-02-18 22:10         ` Peter Zijlstra
2009-02-18 22:23           ` Frank Ch. Eigler
2009-02-18 23:21             ` Peter Zijlstra
2009-02-20 19:52           ` Jason Baron
2009-02-21  3:39             ` Frederic Weisbecker
2009-02-22  3:38             ` KOSAKI Motohiro
2009-02-25 16:48               ` Masami Hiramatsu
2009-02-25 16:57                 ` Jason Baron
2009-02-25 17:34                   ` Mathieu Desnoyers
2009-02-25 18:05                     ` Steven Rostedt
2009-02-25 22:12                       ` Mathieu Desnoyers
2009-02-25 22:20                         ` Frederic Weisbecker
2009-02-25 23:13                           ` Mathieu Desnoyers
2009-02-26  1:41                             ` Steven Rostedt
2009-02-26 12:37                               ` Dominique Toupin
2009-02-27  3:14                                 ` KOSAKI Motohiro
2009-02-27  3:29                                   ` Steven Rostedt
2009-02-27  3:36                                   ` Steven Rostedt
2009-02-27  7:48                                     ` KOSAKI Motohiro
2009-02-27  8:06                                       ` Peter Zijlstra
2009-02-27  8:13                                         ` KOSAKI Motohiro
2009-02-27 13:10                                           ` Arnaldo Carvalho de Melo
2009-02-27 14:43                                       ` Steven Rostedt
2009-02-27  7:23                                   ` Peter Zijlstra
2009-02-25 22:21                         ` Steven Rostedt
2009-02-26 15:11                     ` Jason Baron
2009-02-26 15:32                       ` Steven Rostedt
2009-02-26 15:35                         ` Ingo Molnar
2009-02-26 15:40                       ` Peter Zijlstra
2009-02-26 16:20                       ` Frederic Weisbecker
2009-02-27  3:35                       ` KOSAKI Motohiro
2009-02-27  3:33                     ` KOSAKI Motohiro
2009-02-27  7:25                       ` Peter Zijlstra
2009-02-25 16:58                 ` Mathieu Desnoyers
2009-02-25 17:19                   ` Masami Hiramatsu
2009-02-27  3:08                     ` KOSAKI Motohiro
2009-02-18 23:34       ` Kyle McMartin
2009-02-19  2:13       ` Frederic Weisbecker
2009-02-19  1:46   ` Frederic Weisbecker [this message]

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=20090219014638.GA5785@nowhere \
    --to=fweisbec@gmail.com \
    --cc=acme@ghostprotocols.net \
    --cc=compudj@krystal.dyndns.org \
    --cc=fche@redhat.com \
    --cc=jbaron@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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