diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/perf_counter/kerneltop.c | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/Documentation/perf_counter/kerneltop.c b/Documentation/perf_counter/kerneltop.c index 4f8d7917aba1..15f3a5f90198 100644 --- a/Documentation/perf_counter/kerneltop.c +++ b/Documentation/perf_counter/kerneltop.c | |||
@@ -636,16 +636,20 @@ static void print_sym_table(void) | |||
636 | int counter; | 636 | int counter; |
637 | float events_per_sec = events/delay_secs; | 637 | float events_per_sec = events/delay_secs; |
638 | float kevents_per_sec = (events-userspace_events)/delay_secs; | 638 | float kevents_per_sec = (events-userspace_events)/delay_secs; |
639 | float sum_kevents = 0.0; | ||
639 | 640 | ||
640 | events = userspace_events = 0; | 641 | events = userspace_events = 0; |
641 | memcpy(tmp, sym_table, sizeof(sym_table[0])*sym_table_count); | 642 | memcpy(tmp, sym_table, sizeof(sym_table[0])*sym_table_count); |
642 | qsort(tmp, sym_table_count, sizeof(tmp[0]), compare); | 643 | qsort(tmp, sym_table_count, sizeof(tmp[0]), compare); |
643 | 644 | ||
645 | for (i = 0; i < sym_table_count && tmp[i].count[0]; i++) | ||
646 | sum_kevents += tmp[i].count[0]; | ||
647 | |||
644 | write(1, CONSOLE_CLEAR, strlen(CONSOLE_CLEAR)); | 648 | write(1, CONSOLE_CLEAR, strlen(CONSOLE_CLEAR)); |
645 | 649 | ||
646 | printf( | 650 | printf( |
647 | "------------------------------------------------------------------------------\n"); | 651 | "------------------------------------------------------------------------------\n"); |
648 | printf( " KernelTop:%8.0f irqs/sec kernel:%3.1f%% [%s, ", | 652 | printf( " KernelTop:%8.0f irqs/sec kernel:%4.1f%% [%s, ", |
649 | events_per_sec, | 653 | events_per_sec, |
650 | 100.0 - (100.0*((events_per_sec-kevents_per_sec)/events_per_sec)), | 654 | 100.0 - (100.0*((events_per_sec-kevents_per_sec)/events_per_sec)), |
651 | nmi ? "NMI" : "IRQ"); | 655 | nmi ? "NMI" : "IRQ"); |
@@ -679,34 +683,31 @@ static void print_sym_table(void) | |||
679 | printf("------------------------------------------------------------------------------\n\n"); | 683 | printf("------------------------------------------------------------------------------\n\n"); |
680 | 684 | ||
681 | if (nr_counters == 1) | 685 | if (nr_counters == 1) |
682 | printf(" events"); | 686 | printf(" events pcnt"); |
683 | else | 687 | else |
684 | printf(" weight events"); | 688 | printf(" weight events pcnt"); |
685 | 689 | ||
686 | printf(" RIP kernel function\n" | 690 | printf(" RIP kernel function\n" |
687 | " ______ ______ ________________ _______________\n\n" | 691 | " ______ ______ _____ ________________ _______________\n\n" |
688 | ); | 692 | ); |
689 | 693 | ||
690 | printed = 0; | 694 | for (i = 0, printed = 0; i < sym_table_count; i++) { |
691 | for (i = 0; i < sym_table_count; i++) { | 695 | float pcnt; |
692 | int count; | 696 | int count; |
693 | 697 | ||
694 | if (nr_counters == 1) { | 698 | if (printed <= 18 && tmp[i].count[0] >= count_filter) { |
695 | if (printed <= 18 && | 699 | pcnt = 100.0 - (100.0*((sum_kevents-tmp[i].count[0])/sum_kevents)); |
696 | tmp[i].count[0] >= count_filter) { | 700 | |
697 | printf("%19.2f - %016llx : %s\n", | 701 | if (nr_counters == 1) |
698 | sym_weight(tmp + i), tmp[i].addr, tmp[i].sym); | 702 | printf("%19.2f - %4.1f%% - %016llx : %s\n", |
699 | printed++; | 703 | sym_weight(tmp + i), |
700 | } | 704 | pcnt, tmp[i].addr, tmp[i].sym); |
701 | } else { | 705 | else |
702 | if (printed <= 18 && | 706 | printf("%8.1f %10ld - %4.1f%% - %016llx : %s\n", |
703 | tmp[i].count[0] >= count_filter) { | 707 | sym_weight(tmp + i), |
704 | printf("%8.1f %10ld - %016llx : %s\n", | 708 | tmp[i].count[0], |
705 | sym_weight(tmp + i), | 709 | pcnt, tmp[i].addr, tmp[i].sym); |
706 | tmp[i].count[0], | 710 | printed++; |
707 | tmp[i].addr, tmp[i].sym); | ||
708 | printed++; | ||
709 | } | ||
710 | } | 711 | } |
711 | /* | 712 | /* |
712 | * Add decay to the counts: | 713 | * Add decay to the counts: |