aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-sched.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2013-09-11 08:46:56 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-11-04 09:50:28 -0500
commitb9c5143a012a543c4ee872498d6dbae5c10beb2e (patch)
treed7a288aefff2a6d50c5090a7608e63372e5776af /tools/perf/builtin-sched.c
parent6e6dc401d528e3b64626de82322fa237f1c1e576 (diff)
perf tools: Use an accessor to read thread comm
As the thread comm is going to be implemented by way of a more complicated data structure than just a pointer to a string from the thread struct, convert the readers of comm to use an accessor instead of accessing it directly. The accessor will be later overriden to support an enhanced comm implementation. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Tested-by: Jiri Olsa <jolsa@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-wr683zwy94hmj4ibogmnv9ce@git.kernel.org [ Rename thread__comm_curr() to thread__comm_str() ] Signed-off-by: Namhyung Kim <namhyung@kernel.org> [ Fixed up some minor const pointer issues ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-sched.c')
-rw-r--r--tools/perf/builtin-sched.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index ddb5dc15be17..a81ab1828aa5 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -737,12 +737,12 @@ static int replay_fork_event(struct perf_sched *sched,
737 737
738 if (verbose) { 738 if (verbose) {
739 printf("fork event\n"); 739 printf("fork event\n");
740 printf("... parent: %s/%d\n", parent->comm, parent->tid); 740 printf("... parent: %s/%d\n", thread__comm_str(parent), parent->tid);
741 printf("... child: %s/%d\n", child->comm, child->tid); 741 printf("... child: %s/%d\n", thread__comm_str(child), child->tid);
742 } 742 }
743 743
744 register_pid(sched, parent->tid, parent->comm); 744 register_pid(sched, parent->tid, thread__comm_str(parent));
745 register_pid(sched, child->tid, child->comm); 745 register_pid(sched, child->tid, thread__comm_str(child));
746 return 0; 746 return 0;
747} 747}
748 748
@@ -1077,7 +1077,7 @@ static int latency_migrate_task_event(struct perf_sched *sched,
1077 if (!atoms) { 1077 if (!atoms) {
1078 if (thread_atoms_insert(sched, migrant)) 1078 if (thread_atoms_insert(sched, migrant))
1079 return -1; 1079 return -1;
1080 register_pid(sched, migrant->tid, migrant->comm); 1080 register_pid(sched, migrant->tid, thread__comm_str(migrant));
1081 atoms = thread_atoms_search(&sched->atom_root, migrant, &sched->cmp_pid); 1081 atoms = thread_atoms_search(&sched->atom_root, migrant, &sched->cmp_pid);
1082 if (!atoms) { 1082 if (!atoms) {
1083 pr_err("migration-event: Internal tree error"); 1083 pr_err("migration-event: Internal tree error");
@@ -1111,13 +1111,13 @@ static void output_lat_thread(struct perf_sched *sched, struct work_atoms *work_
1111 /* 1111 /*
1112 * Ignore idle threads: 1112 * Ignore idle threads:
1113 */ 1113 */
1114 if (!strcmp(work_list->thread->comm, "swapper")) 1114 if (!strcmp(thread__comm_str(work_list->thread), "swapper"))
1115 return; 1115 return;
1116 1116
1117 sched->all_runtime += work_list->total_runtime; 1117 sched->all_runtime += work_list->total_runtime;
1118 sched->all_count += work_list->nb_atoms; 1118 sched->all_count += work_list->nb_atoms;
1119 1119
1120 ret = printf(" %s:%d ", work_list->thread->comm, work_list->thread->tid); 1120 ret = printf(" %s:%d ", thread__comm_str(work_list->thread), work_list->thread->tid);
1121 1121
1122 for (i = 0; i < 24 - ret; i++) 1122 for (i = 0; i < 24 - ret; i++)
1123 printf(" "); 1123 printf(" ");
@@ -1334,7 +1334,7 @@ static int map_switch_event(struct perf_sched *sched, struct perf_evsel *evsel,
1334 printf(" %12.6f secs ", (double)timestamp/1e9); 1334 printf(" %12.6f secs ", (double)timestamp/1e9);
1335 if (new_shortname) { 1335 if (new_shortname) {
1336 printf("%s => %s:%d\n", 1336 printf("%s => %s:%d\n",
1337 sched_in->shortname, sched_in->comm, sched_in->tid); 1337 sched_in->shortname, thread__comm_str(sched_in), sched_in->tid);
1338 } else { 1338 } else {
1339 printf("\n"); 1339 printf("\n");
1340 } 1340 }