aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2016-05-03 07:54:45 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-05-05 20:04:00 -0400
commit69849fc5d2119799509026df7a6fd5ffe5a578b3 (patch)
tree6e12f693cc46358ce265f4d8269be67babacb895
parent2e0453af4e16e97268b9e66aad37beb607ed7c0f (diff)
perf hists: Move sort__has_dso 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_dso 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-5-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/ui/browsers/hists.c8
-rw-r--r--tools/perf/util/hist.h1
-rw-r--r--tools/perf/util/sort.c7
-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 b66bf83ed883..6b2f95300e35 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -2380,7 +2380,7 @@ do_zoom_dso(struct hist_browser *browser, struct popup_action *act)
2380{ 2380{
2381 struct map *map = act->ms.map; 2381 struct map *map = act->ms.map;
2382 2382
2383 if (!sort__has_dso || map == NULL) 2383 if (!hists__has(browser->hists, dso) || map == NULL)
2384 return 0; 2384 return 0;
2385 2385
2386 if (browser->hists->dso_filter) { 2386 if (browser->hists->dso_filter) {
@@ -2407,7 +2407,7 @@ static int
2407add_dso_opt(struct hist_browser *browser, struct popup_action *act, 2407add_dso_opt(struct hist_browser *browser, struct popup_action *act,
2408 char **optstr, struct map *map) 2408 char **optstr, struct map *map)
2409{ 2409{
2410 if (!sort__has_dso || map == NULL) 2410 if (!hists__has(browser->hists, dso) || map == NULL)
2411 return 0; 2411 return 0;
2412 2412
2413 if (asprintf(optstr, "Zoom %s %s DSO", 2413 if (asprintf(optstr, "Zoom %s %s DSO",
@@ -2429,10 +2429,10 @@ do_browse_map(struct hist_browser *browser __maybe_unused,
2429} 2429}
2430 2430
2431static int 2431static int
2432add_map_opt(struct hist_browser *browser __maybe_unused, 2432add_map_opt(struct hist_browser *browser,
2433 struct popup_action *act, char **optstr, struct map *map) 2433 struct popup_action *act, char **optstr, struct map *map)
2434{ 2434{
2435 if (!sort__has_dso || map == NULL) 2435 if (!hists__has(browser->hists, dso) || map == NULL)
2436 return 0; 2436 return 0;
2437 2437
2438 if (asprintf(optstr, "Browse map details") < 0) 2438 if (asprintf(optstr, "Browse map details") < 0)
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index c3a77502e22b..4302f34f36ae 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -244,6 +244,7 @@ struct perf_hpp_list {
244 int need_collapse; 244 int need_collapse;
245 int parent; 245 int parent;
246 int sym; 246 int sym;
247 int dso;
247}; 248};
248 249
249extern struct perf_hpp_list perf_hpp_list; 250extern struct perf_hpp_list perf_hpp_list;
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 544ab376ac42..2446c39b5fa6 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_dso = 0;
25int sort__has_socket = 0; 24int sort__has_socket = 0;
26int sort__has_thread = 0; 25int sort__has_thread = 0;
27int sort__has_comm = 0; 26int sort__has_comm = 0;
@@ -241,7 +240,7 @@ sort__sym_cmp(struct hist_entry *left, struct hist_entry *right)
241 * comparing symbol address alone is not enough since it's a 240 * comparing symbol address alone is not enough since it's a
242 * relative address within a dso. 241 * relative address within a dso.
243 */ 242 */
244 if (!sort__has_dso) { 243 if (!hists__has(left->hists, dso) || hists__has(right->hists, dso)) {
245 ret = sort__dso_cmp(left, right); 244 ret = sort__dso_cmp(left, right);
246 if (ret != 0) 245 if (ret != 0)
247 return ret; 246 return ret;
@@ -2255,7 +2254,7 @@ static int sort_dimension__add(struct perf_hpp_list *list, const char *tok,
2255 sd->entry->se_collapse = sort__sym_sort; 2254 sd->entry->se_collapse = sort__sym_sort;
2256 2255
2257 } else if (sd->entry == &sort_dso) { 2256 } else if (sd->entry == &sort_dso) {
2258 sort__has_dso = 1; 2257 list->dso = 1;
2259 } else if (sd->entry == &sort_socket) { 2258 } else if (sd->entry == &sort_socket) {
2260 sort__has_socket = 1; 2259 sort__has_socket = 1;
2261 } else if (sd->entry == &sort_thread) { 2260 } else if (sd->entry == &sort_thread) {
@@ -2746,7 +2745,7 @@ void reset_output_field(void)
2746 perf_hpp_list.need_collapse = 0; 2745 perf_hpp_list.need_collapse = 0;
2747 perf_hpp_list.parent = 0; 2746 perf_hpp_list.parent = 0;
2748 perf_hpp_list.sym = 0; 2747 perf_hpp_list.sym = 0;
2749 sort__has_dso = 0; 2748 perf_hpp_list.dso = 0;
2750 2749
2751 field_order = NULL; 2750 field_order = NULL;
2752 sort_order = NULL; 2751 sort_order = NULL;
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h
index 9a5e7d4a2cac..87d4addf92b5 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_dso;
35extern int sort__has_socket; 34extern int sort__has_socket;
36extern int sort__has_thread; 35extern int sort__has_thread;
37extern int sort__has_comm; 36extern int sort__has_comm;