Skip to content

Commit d9340c1

Browse files
author
Ingo Molnar
committed
perf sched: Display time in milliseconds, reorganize output
After: ----------------------------------------------------------------------------------- Task | runtime ms | switches | average delay ms | maximum delay ms | ----------------------------------------------------------------------------------- migration/0 | 0.000 ms | 1 | avg: 0.047 ms | max: 0.047 ms | ksoftirqd/0 | 0.000 ms | 1 | avg: 0.039 ms | max: 0.039 ms | migration/1 | 0.000 ms | 3 | avg: 0.013 ms | max: 0.016 ms | migration/3 | 0.000 ms | 2 | avg: 0.003 ms | max: 0.004 ms | migration/4 | 0.000 ms | 1 | avg: 0.022 ms | max: 0.022 ms | distccd | 0.000 ms | 1 | avg: 0.004 ms | max: 0.004 ms | distccd | 0.000 ms | 1 | avg: 0.014 ms | max: 0.014 ms | distccd | 0.000 ms | 2 | avg: 0.000 ms | max: 0.000 ms | distccd | 0.000 ms | 2 | avg: 0.012 ms | max: 0.019 ms | distccd | 0.000 ms | 1 | avg: 0.002 ms | max: 0.002 ms | as | 0.000 ms | 2 | avg: 0.019 ms | max: 0.019 ms | as | 0.000 ms | 3 | avg: 0.015 ms | max: 0.017 ms | as | 0.000 ms | 1 | avg: 0.009 ms | max: 0.009 ms | perf | 0.000 ms | 1 | avg: 0.001 ms | max: 0.001 ms | gcc | 0.000 ms | 1 | avg: 0.021 ms | max: 0.021 ms | run-mozilla.sh | 0.000 ms | 2 | avg: 0.010 ms | max: 0.017 ms | mozilla-plugin- | 0.000 ms | 1 | avg: 0.006 ms | max: 0.006 ms | gcc | 0.000 ms | 2 | avg: 0.013 ms | max: 0.013 ms | ----------------------------------------------------------------------------------- (The runtime ms column is not filled in yet.) Cc: Peter Zijlstra <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Frederic Weisbecker <[email protected]> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <[email protected]>
1 parent 46f392c commit d9340c1

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

tools/perf/builtin-sched.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,14 +1096,15 @@ static void output_lat_thread(struct thread_latency *lat)
10961096
if (!count)
10971097
return;
10981098

1099-
ret = printf("%s", lat->thread->comm);
1099+
ret = printf(" %s ", lat->thread->comm);
11001100

1101-
for (i = 0; i < 25 - ret; i++)
1101+
for (i = 0; i < 19 - ret; i++)
11021102
printf(" ");
11031103

11041104
avg = total / count;
11051105

1106-
printf("%5d %10llu %10llu %10llu\n", count, total, avg, max);
1106+
printf("|%9.3f ms |%9d | avg:%9.3f ms | max:%9.3f ms |\n",
1107+
0.0, count, (double)avg/1e9, (double)max/1e9);
11071108
}
11081109

11091110
static void __cmd_lat(void)
@@ -1113,11 +1114,9 @@ static void __cmd_lat(void)
11131114
setup_pager();
11141115
read_events();
11151116

1116-
printf(" Tasks");
1117-
printf(" count");
1118-
printf(" total");
1119-
printf(" avg");
1120-
printf(" max\n\n");
1117+
printf("-----------------------------------------------------------------------------------\n");
1118+
printf(" Task | runtime ms | switches | average delay ms | maximum delay ms |\n");
1119+
printf("-----------------------------------------------------------------------------------\n");
11211120

11221121
next = rb_first(&lat_snapshot_root);
11231122

@@ -1128,6 +1127,8 @@ static void __cmd_lat(void)
11281127
output_lat_thread(lat);
11291128
next = rb_next(next);
11301129
}
1130+
1131+
printf("-----------------------------------------------------------------------------------\n");
11311132
}
11321133

11331134
static struct trace_sched_handler *trace_handler;

tools/perf/util/trace-event-read.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,12 +458,13 @@ struct record *trace_read_data(int cpu)
458458
return data;
459459
}
460460

461-
void trace_report (void)
461+
void trace_report(void)
462462
{
463463
const char *input_file = "trace.info";
464464
char buf[BUFSIZ];
465465
char test[] = { 23, 8, 68 };
466466
char *version;
467+
int show_version = 0;
467468
int show_funcs = 0;
468469
int show_printk = 0;
469470

@@ -480,7 +481,8 @@ void trace_report (void)
480481
die("not a trace file (missing tracing)");
481482

482483
version = read_string();
483-
printf("version = %s\n", version);
484+
if (show_version)
485+
printf("version = %s\n", version);
484486
free(version);
485487

486488
read_or_die(buf, 1);

0 commit comments

Comments
 (0)