All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] perf tools: add 'perf irq' to measure the hardware interrupts
@ 2021-01-12 12:55 Bixuan Cui
  2021-01-12 12:55 ` [PATCH 1/2] " Bixuan Cui
  2021-01-12 12:55 ` [PATCH 2/2] perf tools: Add documentation for 'perf irq' command Bixuan Cui
  0 siblings, 2 replies; 7+ messages in thread
From: Bixuan Cui @ 2021-01-12 12:55 UTC (permalink / raw)
  To: peterz, mingo, acme, mark.rutland, alexander.shishkin, jolsa,
	namhyung, linux-kernel
  Cc: john.wanghui

When the hardware interrupt processing function is executed, the interrupt and 
preemption of current cpu are disabled. As a result, the task is suspended.
The execution of the hardware processing function takes a long time
(for example 5 ms), will affect the task scheduling performance.

This patches provides the 'perf irq' command to trace and calculate the time
consumed of the hardware irq function.


[verse]
'perf irq' {record|timeconsume|script}

There are several variants of 'perf irq':

  'perf irq record <command>' to record the irq handler events
  of an arbitrary workload.

  'perf irq script' to see a detailed trace of the workload that
   was recorded (aliased to 'perf script' for now).

  'perf irq timeconsume' to calculate the time consumed by each
   hardware interrupt processing function.

    Example usage:
        perf irq record -- sleep 1
        perf irq timeconsume

   By default it shows the individual irq events, including the irq name,
   cpu(execute the hardware interrupt processing function), time consumed,
   entry time and exit time for the each hardware irq:

   -------------------------------------------------------------------------------------------------------------------------------------------
     Irq name         |  CPU   | Time consume us | Handler entry time | Handler exit time
   -------------------------------------------------------------------------------------------------------------------------------------------
     enp2s0f2-tx-0    | [0006] |      0.000001 s |   6631263.313329 s |   6631263.313330 s

   -------------------------------------------------------------------------------------------------------------------------------------------
     Irq name         |  CPU   | Time consume us | Handler entry time | Handler exit time
   -------------------------------------------------------------------------------------------------------------------------------------------
     megasas          | [0013] |      0.000003 s |   6631263.209564 s |   6631263.209567 s

   -------------------------------------------------------------------------------------------------------------------------------------------
     Irq name         |  CPU   | Time consume us | Handler entry time | Handler exit time
   -------------------------------------------------------------------------------------------------------------------------------------------
     acpi             | [0016] |      0.000018 s |   6631263.085787 s |   6631263.085805 s

Bixuan Cui (2):
  perf tools: add 'perf irq' to measure the hardware interrupts
  perf tools: Add documentation for 'perf irq' command

 tools/perf/Build                      |   1 +
 tools/perf/Documentation/perf-irq.txt |  58 ++++++
 tools/perf/builtin-irq.c              | 288 ++++++++++++++++++++++++++
 tools/perf/builtin.h                  |   1 +
 tools/perf/command-list.txt           |   1 +
 tools/perf/perf.c                     |   1 +
 6 files changed, 350 insertions(+)
 create mode 100644 tools/perf/Documentation/perf-irq.txt
 create mode 100644 tools/perf/builtin-irq.c

-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH 0/2] perf tools: add 'perf irq' to measure the hardware interrupts
@ 2021-01-13  0:59 Bixuan Cui
  0 siblings, 0 replies; 7+ messages in thread
From: Bixuan Cui @ 2021-01-13  0:59 UTC (permalink / raw)
  To: peterz, mingo, acme, mark.rutland, alexander.shishkin, jolsa,
	namhyung, linux-kernel
  Cc: john.wanghui

When the hardware interrupt processing function is executed, the interrupt and 
preemption of current cpu are disabled. As a result, the task is suspended.
The execution of the hardware processing function takes a long time
(for example 5 ms), will affect the task scheduling performance.

This patches provides the 'perf irq' command to trace and calculate the time
consumed of the hardware irq function.


[verse]
'perf irq' {record|timeconsume|script}

There are several variants of 'perf irq':

  'perf irq record <command>' to record the irq handler events
  of an arbitrary workload.

  'perf irq script' to see a detailed trace of the workload that
   was recorded (aliased to 'perf script' for now).

  'perf irq timeconsume' to calculate the time consumed by each
   hardware interrupt processing function.

    Example usage:
        perf irq record -- sleep 1
        perf irq timeconsume

   By default it shows the individual irq events, including the irq name,
   cpu(execute the hardware interrupt processing function), time consumed,
   entry time and exit time for the each hardware irq:

   -------------------------------------------------------------------------------------------------------------------------------------------
     Irq name         |  CPU   | Time consume us | Handler entry time | Handler exit time
   -------------------------------------------------------------------------------------------------------------------------------------------
     enp2s0f2-tx-0    | [0006] |      0.000001 s |   6631263.313329 s |   6631263.313330 s

   -------------------------------------------------------------------------------------------------------------------------------------------
     Irq name         |  CPU   | Time consume us | Handler entry time | Handler exit time
   -------------------------------------------------------------------------------------------------------------------------------------------
     megasas          | [0013] |      0.000003 s |   6631263.209564 s |   6631263.209567 s

   -------------------------------------------------------------------------------------------------------------------------------------------
     Irq name         |  CPU   | Time consume us | Handler entry time | Handler exit time
   -------------------------------------------------------------------------------------------------------------------------------------------
     acpi             | [0016] |      0.000018 s |   6631263.085787 s |   6631263.085805 s

Bixuan Cui (2):
  perf tools: add 'perf irq' to measure the hardware interrupts
  perf tools: Add documentation for 'perf irq' command

 tools/perf/Build                      |   1 +
 tools/perf/Documentation/perf-irq.txt |  58 ++++++
 tools/perf/builtin-irq.c              | 288 ++++++++++++++++++++++++++
 tools/perf/builtin.h                  |   1 +
 tools/perf/command-list.txt           |   1 +
 tools/perf/perf.c                     |   1 +
 6 files changed, 350 insertions(+)
 create mode 100644 tools/perf/Documentation/perf-irq.txt
 create mode 100644 tools/perf/builtin-irq.c

-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-01-14  7:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-12 12:55 [PATCH 0/2] perf tools: add 'perf irq' to measure the hardware interrupts Bixuan Cui
2021-01-12 12:55 ` [PATCH 1/2] " Bixuan Cui
2021-01-12 19:50   ` Alexei Budankov
2021-01-14  7:29     ` Bixuan Cui
2021-01-12 12:55 ` [PATCH 2/2] perf tools: Add documentation for 'perf irq' command Bixuan Cui
2021-01-12 19:51   ` Alexei Budankov
2021-01-13  0:59 [PATCH 0/2] perf tools: add 'perf irq' to measure the hardware interrupts Bixuan Cui

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.