aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/browsers/hists.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/ui/browsers/hists.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/ui/browsers/hists.c')
-rw-r--r--tools/perf/ui/browsers/hists.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 7ef36c360471..a91b6b219412 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -1255,7 +1255,7 @@ static int hists__browser_title(struct hists *hists, char *bf, size_t size,
1255 if (thread) 1255 if (thread)
1256 printed += scnprintf(bf + printed, size - printed, 1256 printed += scnprintf(bf + printed, size - printed,
1257 ", Thread: %s(%d)", 1257 ", Thread: %s(%d)",
1258 (thread->comm_set ? thread->comm : ""), 1258 (thread->comm_set ? thread__comm_str(thread) : ""),
1259 thread->tid); 1259 thread->tid);
1260 if (dso) 1260 if (dso)
1261 printed += scnprintf(bf + printed, size - printed, 1261 printed += scnprintf(bf + printed, size - printed,
@@ -1578,7 +1578,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
1578 if (thread != NULL && 1578 if (thread != NULL &&
1579 asprintf(&options[nr_options], "Zoom %s %s(%d) thread", 1579 asprintf(&options[nr_options], "Zoom %s %s(%d) thread",
1580 (browser->hists->thread_filter ? "out of" : "into"), 1580 (browser->hists->thread_filter ? "out of" : "into"),
1581 (thread->comm_set ? thread->comm : ""), 1581 (thread->comm_set ? thread__comm_str(thread) : ""),
1582 thread->tid) > 0) 1582 thread->tid) > 0)
1583 zoom_thread = nr_options++; 1583 zoom_thread = nr_options++;
1584 1584
@@ -1598,7 +1598,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
1598 struct symbol *sym; 1598 struct symbol *sym;
1599 1599
1600 if (asprintf(&options[nr_options], "Run scripts for samples of thread [%s]", 1600 if (asprintf(&options[nr_options], "Run scripts for samples of thread [%s]",
1601 browser->he_selection->thread->comm) > 0) 1601 thread__comm_str(browser->he_selection->thread)) > 0)
1602 scripts_comm = nr_options++; 1602 scripts_comm = nr_options++;
1603 1603
1604 sym = browser->he_selection->ms.sym; 1604 sym = browser->he_selection->ms.sym;
@@ -1701,7 +1701,7 @@ zoom_out_thread:
1701 sort_thread.elide = false; 1701 sort_thread.elide = false;
1702 } else { 1702 } else {
1703 ui_helpline__fpush("To zoom out press <- or -> + \"Zoom out of %s(%d) thread\"", 1703 ui_helpline__fpush("To zoom out press <- or -> + \"Zoom out of %s(%d) thread\"",
1704 thread->comm_set ? thread->comm : "", 1704 thread->comm_set ? thread__comm_str(thread) : "",
1705 thread->tid); 1705 thread->tid);
1706 browser->hists->thread_filter = thread; 1706 browser->hists->thread_filter = thread;
1707 sort_thread.elide = true; 1707 sort_thread.elide = true;
@@ -1717,7 +1717,7 @@ do_scripts:
1717 memset(script_opt, 0, 64); 1717 memset(script_opt, 0, 64);
1718 1718
1719 if (choice == scripts_comm) 1719 if (choice == scripts_comm)
1720 sprintf(script_opt, " -c %s ", browser->he_selection->thread->comm); 1720 sprintf(script_opt, " -c %s ", thread__comm_str(browser->he_selection->thread));
1721 1721
1722 if (choice == scripts_symbol) 1722 if (choice == scripts_symbol)
1723 sprintf(script_opt, " -S %s ", browser->he_selection->ms.sym->name); 1723 sprintf(script_opt, " -S %s ", browser->he_selection->ms.sym->name);