From 7d33844ed38799aab57f785425732608cc5517c6 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Tue, 2 Jun 2009 21:02:36 +0200 Subject: [PATCH] --- yaml --- r: 147612 b: refs/heads/master c: 436224a6d8bb3e29fe0cc18122f8d1f593da67b8 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/Documentation/perf_counter/builtin-report.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 252426ae7ece..0271b9f07b9a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c70975bc8d5bac487616785f5d5bc7b090dfa2d9 +refs/heads/master: 436224a6d8bb3e29fe0cc18122f8d1f593da67b8 diff --git a/trunk/Documentation/perf_counter/builtin-report.c b/trunk/Documentation/perf_counter/builtin-report.c index 19c1e056bb66..6d68f3aa86b7 100644 --- a/trunk/Documentation/perf_counter/builtin-report.c +++ b/trunk/Documentation/perf_counter/builtin-report.c @@ -612,6 +612,17 @@ static size_t output__fprintf(FILE *fp, uint64_t total_samples) return ret; } +static void register_idle_thread(void) +{ + struct thread *thread = threads__findnew(0); + + if (thread == NULL || + thread__set_comm(thread, "[idle]")) { + fprintf(stderr, "problem inserting idle task.\n"); + exit(-1); + } +} + static int __cmd_report(void) { @@ -626,6 +637,8 @@ static int __cmd_report(void) char cwd[PATH_MAX], *cwdp = cwd; int cwdlen; + register_idle_thread(); + input = open(input_name, O_RDONLY); if (input < 0) { perror("failed to open file");