aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-annotate.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-08-31 00:45:18 -0400
committerIngo Molnar <mingo@elte.hu>2009-08-31 04:04:48 -0400
commit5b447a6a13ea823b698bf4c01193654fd7ebf4ec (patch)
tree7d3e1c20cf2fe4dbeb1a64910ace3e222bc6ad6a /tools/perf/builtin-annotate.c
parentec7ba4ea1d605029fb09601ab4ad3053bc1f519c (diff)
perf tools: Librarize idle thread registration
Librarize register_idle_thread() used by annotate and report. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> LKML-Reference: <1251693921-6579-1-git-send-email-fweisbec@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-annotate.c')
-rw-r--r--tools/perf/builtin-annotate.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 4c7bc443623..043d85b7e25 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -472,17 +472,6 @@ static void output__resort(void)
472 } 472 }
473} 473}
474 474
475static void register_idle_thread(void)
476{
477 struct thread *thread = threads__findnew(0, &threads, &last_match);
478
479 if (thread == NULL ||
480 thread__set_comm(thread, "[idle]")) {
481 fprintf(stderr, "problem inserting idle task.\n");
482 exit(-1);
483 }
484}
485
486static unsigned long total = 0, 475static unsigned long total = 0,
487 total_mmap = 0, 476 total_mmap = 0,
488 total_comm = 0, 477 total_comm = 0,
@@ -970,7 +959,7 @@ static int __cmd_annotate(void)
970 uint32_t size; 959 uint32_t size;
971 char *buf; 960 char *buf;
972 961
973 register_idle_thread(); 962 register_idle_thread(&threads, &last_match);
974 963
975 input = open(input_name, O_RDONLY); 964 input = open(input_name, O_RDONLY);
976 if (input < 0) { 965 if (input < 0) {