提交 3e304147 编写于 作者: I Ingo Molnar

perf sched: Output runtime and context switch totals

After:

-----------------------------------------------------------------------------------
 Task              |  Runtime ms | Switches | Average delay ms | Maximum delay ms |
-----------------------------------------------------------------------------------
 make              |    0.678 ms |       13 | avg:    0.018 ms | max:    0.050 ms |
 gcc               |    0.014 ms |        2 | avg:    0.320 ms | max:    0.627 ms |
 gcc               |    0.000 ms |        2 | avg:    0.185 ms | max:    0.369 ms |
...
-----------------------------------------------------------------------------------
 TOTAL:            |   21.316 ms |       63 |
---------------------------------------------

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 ea92ed5a
...@@ -1087,6 +1087,9 @@ static struct trace_sched_handler lat_ops = { ...@@ -1087,6 +1087,9 @@ static struct trace_sched_handler lat_ops = {
.fork_event = latency_fork_event, .fork_event = latency_fork_event,
}; };
static u64 all_runtime;
static u64 all_count;
static void output_lat_thread(struct thread_latency *lat) static void output_lat_thread(struct thread_latency *lat)
{ {
struct lat_snapshot *shot; struct lat_snapshot *shot;
...@@ -1111,6 +1114,9 @@ static void output_lat_thread(struct thread_latency *lat) ...@@ -1111,6 +1114,9 @@ static void output_lat_thread(struct thread_latency *lat)
total += delta; total += delta;
} }
all_runtime += total_runtime;
all_count += count;
if (!count) if (!count)
return; return;
...@@ -1133,7 +1139,7 @@ static void __cmd_lat(void) ...@@ -1133,7 +1139,7 @@ static void __cmd_lat(void)
read_events(); read_events();
printf("-----------------------------------------------------------------------------------\n"); printf("-----------------------------------------------------------------------------------\n");
printf(" Task | runtime ms | switches | average delay ms | maximum delay ms |\n"); printf(" Task | Runtime ms | Switches | Average delay ms | Maximum delay ms |\n");
printf("-----------------------------------------------------------------------------------\n"); printf("-----------------------------------------------------------------------------------\n");
next = rb_first(&lat_snapshot_root); next = rb_first(&lat_snapshot_root);
...@@ -1147,6 +1153,9 @@ static void __cmd_lat(void) ...@@ -1147,6 +1153,9 @@ static void __cmd_lat(void)
} }
printf("-----------------------------------------------------------------------------------\n"); printf("-----------------------------------------------------------------------------------\n");
printf(" TOTAL: |%9.3f ms |%9Ld |\n",
(double)all_runtime/1e9, all_count);
printf("---------------------------------------------\n");
} }
static struct trace_sched_handler *trace_handler; static struct trace_sched_handler *trace_handler;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册