Skip to content

Commit

Permalink
perf report: Separate out idle threads
Browse files Browse the repository at this point in the history
Introduce the special comm name [idle] for idle theads.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: John Kacur <jkacur@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Jun 2, 2009
1 parent c70975b commit 436224a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Documentation/perf_counter/builtin-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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");
Expand Down

0 comments on commit 436224a

Please sign in to comment.