Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147338
b: refs/heads/master
c: 6278af6
h: refs/heads/master
v: v3
  • Loading branch information
Mike Galbraith authored and Ingo Molnar committed Apr 7, 2009
1 parent 2cfc917 commit ffe65c2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bce379bf358738ab8efc8cda2594a299ac685085
refs/heads/master: 6278af660ff83fbafb18e53fc2747eb2ee6780fa
45 changes: 23 additions & 22 deletions trunk/Documentation/perf_counter/kerneltop.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,16 +636,20 @@ static void print_sym_table(void)
int counter;
float events_per_sec = events/delay_secs;
float kevents_per_sec = (events-userspace_events)/delay_secs;
float sum_kevents = 0.0;

events = userspace_events = 0;
memcpy(tmp, sym_table, sizeof(sym_table[0])*sym_table_count);
qsort(tmp, sym_table_count, sizeof(tmp[0]), compare);

for (i = 0; i < sym_table_count && tmp[i].count[0]; i++)
sum_kevents += tmp[i].count[0];

write(1, CONSOLE_CLEAR, strlen(CONSOLE_CLEAR));

printf(
"------------------------------------------------------------------------------\n");
printf( " KernelTop:%8.0f irqs/sec kernel:%3.1f%% [%s, ",
printf( " KernelTop:%8.0f irqs/sec kernel:%4.1f%% [%s, ",
events_per_sec,
100.0 - (100.0*((events_per_sec-kevents_per_sec)/events_per_sec)),
nmi ? "NMI" : "IRQ");
Expand Down Expand Up @@ -679,34 +683,31 @@ static void print_sym_table(void)
printf("------------------------------------------------------------------------------\n\n");

if (nr_counters == 1)
printf(" events");
printf(" events pcnt");
else
printf(" weight events");
printf(" weight events pcnt");

printf(" RIP kernel function\n"
" ______ ______ ________________ _______________\n\n"
" ______ ______ _____ ________________ _______________\n\n"
);

printed = 0;
for (i = 0; i < sym_table_count; i++) {
for (i = 0, printed = 0; i < sym_table_count; i++) {
float pcnt;
int count;

if (nr_counters == 1) {
if (printed <= 18 &&
tmp[i].count[0] >= count_filter) {
printf("%19.2f - %016llx : %s\n",
sym_weight(tmp + i), tmp[i].addr, tmp[i].sym);
printed++;
}
} else {
if (printed <= 18 &&
tmp[i].count[0] >= count_filter) {
printf("%8.1f %10ld - %016llx : %s\n",
sym_weight(tmp + i),
tmp[i].count[0],
tmp[i].addr, tmp[i].sym);
printed++;
}
if (printed <= 18 && tmp[i].count[0] >= count_filter) {
pcnt = 100.0 - (100.0*((sum_kevents-tmp[i].count[0])/sum_kevents));

if (nr_counters == 1)
printf("%19.2f - %4.1f%% - %016llx : %s\n",
sym_weight(tmp + i),
pcnt, tmp[i].addr, tmp[i].sym);
else
printf("%8.1f %10ld - %4.1f%% - %016llx : %s\n",
sym_weight(tmp + i),
tmp[i].count[0],
pcnt, tmp[i].addr, tmp[i].sym);
printed++;
}
/*
* Add decay to the counts:
Expand Down

0 comments on commit ffe65c2

Please sign in to comment.