aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2016-05-03 07:54:47 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-05-05 20:04:01 -0400
commitfa82911a1bdf4f9870ffca097d7fe21128b5639c (patch)
tree0f58b9654df678f6915c99d0d7b51ecf0289a1db /tools
parent35a634f76c02b98d31397a589544022b478c0e12 (diff)
perf hists: Move sort__has_thread into struct perf_hpp_list
Now we have sort dimensions private for struct hists, we need to make dimension booleans hists specific as well. Moving sort__has_thread into struct perf_hpp_list. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1462276488-26683-7-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/ui/browsers/hists.c12
-rw-r--r--tools/perf/util/hist.h1
-rw-r--r--tools/perf/util/sort.c3
-rw-r--r--tools/perf/util/sort.h1
4 files changed, 8 insertions, 9 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index b25bf82c121f..dda5b4322945 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -2135,7 +2135,7 @@ static int hists__browser_title(struct hists *hists,
2135 printed += snprintf(bf + printed, size - printed, 2135 printed += snprintf(bf + printed, size - printed,
2136 ", UID: %s", hists->uid_filter_str); 2136 ", UID: %s", hists->uid_filter_str);
2137 if (thread) { 2137 if (thread) {
2138 if (sort__has_thread) { 2138 if (hists__has(hists, thread)) {
2139 printed += scnprintf(bf + printed, size - printed, 2139 printed += scnprintf(bf + printed, size - printed,
2140 ", Thread: %s(%d)", 2140 ", Thread: %s(%d)",
2141 (thread->comm_set ? thread__comm_str(thread) : ""), 2141 (thread->comm_set ? thread__comm_str(thread) : ""),
@@ -2320,7 +2320,7 @@ do_zoom_thread(struct hist_browser *browser, struct popup_action *act)
2320{ 2320{
2321 struct thread *thread = act->thread; 2321 struct thread *thread = act->thread;
2322 2322
2323 if ((!sort__has_thread && !sort__has_comm) || thread == NULL) 2323 if ((!hists__has(browser->hists, thread) && !sort__has_comm) || thread == NULL)
2324 return 0; 2324 return 0;
2325 2325
2326 if (browser->hists->thread_filter) { 2326 if (browser->hists->thread_filter) {
@@ -2329,7 +2329,7 @@ do_zoom_thread(struct hist_browser *browser, struct popup_action *act)
2329 thread__zput(browser->hists->thread_filter); 2329 thread__zput(browser->hists->thread_filter);
2330 ui_helpline__pop(); 2330 ui_helpline__pop();
2331 } else { 2331 } else {
2332 if (sort__has_thread) { 2332 if (hists__has(browser->hists, thread)) {
2333 ui_helpline__fpush("To zoom out press ESC or ENTER + \"Zoom out of %s(%d) thread\"", 2333 ui_helpline__fpush("To zoom out press ESC or ENTER + \"Zoom out of %s(%d) thread\"",
2334 thread->comm_set ? thread__comm_str(thread) : "", 2334 thread->comm_set ? thread__comm_str(thread) : "",
2335 thread->tid); 2335 thread->tid);
@@ -2354,10 +2354,10 @@ add_thread_opt(struct hist_browser *browser, struct popup_action *act,
2354{ 2354{
2355 int ret; 2355 int ret;
2356 2356
2357 if ((!sort__has_thread && !sort__has_comm) || thread == NULL) 2357 if ((!hists__has(browser->hists, thread) && !sort__has_comm) || thread == NULL)
2358 return 0; 2358 return 0;
2359 2359
2360 if (sort__has_thread) { 2360 if (hists__has(browser->hists, thread)) {
2361 ret = asprintf(optstr, "Zoom %s %s(%d) thread", 2361 ret = asprintf(optstr, "Zoom %s %s(%d) thread",
2362 browser->hists->thread_filter ? "out of" : "into", 2362 browser->hists->thread_filter ? "out of" : "into",
2363 thread->comm_set ? thread__comm_str(thread) : "", 2363 thread->comm_set ? thread__comm_str(thread) : "",
@@ -2954,7 +2954,7 @@ skip_annotation:
2954 goto skip_scripting; 2954 goto skip_scripting;
2955 2955
2956 if (browser->he_selection) { 2956 if (browser->he_selection) {
2957 if (sort__has_thread && thread) { 2957 if (hists__has(hists, thread) && thread) {
2958 nr_options += add_script_opt(browser, 2958 nr_options += add_script_opt(browser,
2959 &actions[nr_options], 2959 &actions[nr_options],
2960 &options[nr_options], 2960 &options[nr_options],
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index 66f313936faf..adeb4049c488 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -246,6 +246,7 @@ struct perf_hpp_list {
246 int sym; 246 int sym;
247 int dso; 247 int dso;
248 int socket; 248 int socket;
249 int thread;
249}; 250};
250 251
251extern struct perf_hpp_list perf_hpp_list; 252extern struct perf_hpp_list perf_hpp_list;
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 712a71ad76a6..000d6e901841 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -21,7 +21,6 @@ const char *sort_order;
21const char *field_order; 21const char *field_order;
22regex_t ignore_callees_regex; 22regex_t ignore_callees_regex;
23int have_ignore_callees = 0; 23int have_ignore_callees = 0;
24int sort__has_thread = 0;
25int sort__has_comm = 0; 24int sort__has_comm = 0;
26enum sort_mode sort__mode = SORT_MODE__NORMAL; 25enum sort_mode sort__mode = SORT_MODE__NORMAL;
27 26
@@ -2257,7 +2256,7 @@ static int sort_dimension__add(struct perf_hpp_list *list, const char *tok,
2257 } else if (sd->entry == &sort_socket) { 2256 } else if (sd->entry == &sort_socket) {
2258 list->socket = 1; 2257 list->socket = 1;
2259 } else if (sd->entry == &sort_thread) { 2258 } else if (sd->entry == &sort_thread) {
2260 sort__has_thread = 1; 2259 list->thread = 1;
2261 } else if (sd->entry == &sort_comm) { 2260 } else if (sd->entry == &sort_comm) {
2262 sort__has_comm = 1; 2261 sort__has_comm = 1;
2263 } 2262 }
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h
index 85424a608074..e8d1bf147522 100644
--- a/tools/perf/util/sort.h
+++ b/tools/perf/util/sort.h
@@ -31,7 +31,6 @@ extern const char *parent_pattern;
31extern const char default_sort_order[]; 31extern const char default_sort_order[];
32extern regex_t ignore_callees_regex; 32extern regex_t ignore_callees_regex;
33extern int have_ignore_callees; 33extern int have_ignore_callees;
34extern int sort__has_thread;
35extern int sort__has_comm; 34extern int sort__has_comm;
36extern enum sort_mode sort__mode; 35extern enum sort_mode sort__mode;
37extern struct sort_entry sort_comm; 36extern struct sort_entry sort_comm;