Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hardirqs: Optimize output information and increase CPU display #5228

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kknjh
Copy link
Contributor

@kknjh kknjh commented Mar 10, 2025

Combine the previous count and time into one,
and increase CPU independent statistics and maximum interrupt time

Before:
./hardirqs
Tracing hard irq event time... Hit Ctrl-C to end.
^C
HARDIRQ TOTAL_usecs
enp0s3 254
snd_intel8x0 368

./hardirqs -C
Tracing hard irq events... Hit Ctrl-C to end.
^C
HARDIRQ TOTAL_count
enp0s3 14
ata_piix 2

After:
./hardirqs
Tracing hard irq event time... Hit Ctrl-C to end.
^C
HARDIRQ CPU TOTAL_count TOTAL_usecs MAX_usecs
ata_piix - 2 32 21
enp0s3 - 19 318 42

./hardirqs -C
Tracing hard irq event time... Hit Ctrl-C to end.
^C
HARDIRQ CPU TOTAL_count TOTAL_usecs MAX_usecs
enp0s3 2 111375 1420732 303
enp0s3 9 1546 21826 39
ata_piix 8 8 162 33

Combine the previous count and time into one,
and increase CPU independent statistics and maximum interrupt time

Before:
./hardirqs
Tracing hard irq event time... Hit Ctrl-C to end.
^C
HARDIRQ                    TOTAL_usecs
enp0s3                             254
snd_intel8x0                       368

./hardirqs -C
Tracing hard irq events... Hit Ctrl-C to end.
^C
HARDIRQ                    TOTAL_count
enp0s3                              14
ata_piix                             2

After:
./hardirqs
Tracing hard irq event time... Hit Ctrl-C to end.
^C
HARDIRQ                    CPU TOTAL_count TOTAL_usecs MAX_usecs
ata_piix                     -           2          32        21
enp0s3                       -          19         318        42

./hardirqs -C
Tracing hard irq event time... Hit Ctrl-C to end.
^C
HARDIRQ                    CPU TOTAL_count TOTAL_usecs MAX_usecs
enp0s3                       2      111375     1420732       303
enp0s3                       9        1546       21826        39
ata_piix                     8           8         162        33

Signed-off-by: Feng Yang <yangfeng@kylinos.cn>
@@ -42,7 +42,7 @@ const char *argp_program_bug_address =
const char argp_program_doc[] =
"Summarize hard irq event time as histograms.\n"
"\n"
"USAGE: hardirqs [--help] [-T] [-N] [-d] [interval] [count] [-c CG]\n"
"USAGE: hardirqs [--help] [-T] [-N] [-d] [interval] [-C] [-c CG]\n"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not replace '[count]' with '[-C]'.
I know you want to add a CPU column for the output. What is your use case? How does this help you for production investigation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't replace count with CPU, I just changed count to default display. Count, total time, and max time will all be displayed. Increasing CPU can observe whether the interrupt distribution is balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants