diff options
author | Jiri Olsa <jolsa@kernel.org> | 2016-05-03 07:54:43 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-05-05 20:03:59 -0400 |
commit | de7e6a7c8bf9ee46dcbee749bc3cdd0d9c21998a (patch) | |
tree | 0871fa25e6f6e16516d076d6b0a9acbdd3f39506 /tools | |
parent | 52225036fa8f5aca4c1b7b4f12742f72a1bf9d73 (diff) |
perf hists: Move sort__has_parent 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_parent 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-3-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/builtin-report.c | 2 | ||||
-rw-r--r-- | tools/perf/util/callchain.c | 2 | ||||
-rw-r--r-- | tools/perf/util/hist.h | 1 | ||||
-rw-r--r-- | tools/perf/util/machine.c | 2 | ||||
-rw-r--r-- | tools/perf/util/sort.c | 5 | ||||
-rw-r--r-- | tools/perf/util/sort.h | 1 |
6 files changed, 6 insertions, 7 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 394d05ec0014..87d40e3c4078 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -234,7 +234,7 @@ static int report__setup_sample_type(struct report *rep) | |||
234 | sample_type |= PERF_SAMPLE_BRANCH_STACK; | 234 | sample_type |= PERF_SAMPLE_BRANCH_STACK; |
235 | 235 | ||
236 | if (!is_pipe && !(sample_type & PERF_SAMPLE_CALLCHAIN)) { | 236 | if (!is_pipe && !(sample_type & PERF_SAMPLE_CALLCHAIN)) { |
237 | if (sort__has_parent) { | 237 | if (perf_hpp_list.parent) { |
238 | ui__error("Selected --sort parent, but no " | 238 | ui__error("Selected --sort parent, but no " |
239 | "callchain data. Did you call " | 239 | "callchain data. Did you call " |
240 | "'perf record' without -g?\n"); | 240 | "'perf record' without -g?\n"); |
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c index aa248dcb4440..07fd30bc2f81 100644 --- a/tools/perf/util/callchain.c +++ b/tools/perf/util/callchain.c | |||
@@ -799,7 +799,7 @@ int sample__resolve_callchain(struct perf_sample *sample, | |||
799 | return 0; | 799 | return 0; |
800 | 800 | ||
801 | if (symbol_conf.use_callchain || symbol_conf.cumulate_callchain || | 801 | if (symbol_conf.use_callchain || symbol_conf.cumulate_callchain || |
802 | sort__has_parent) { | 802 | perf_hpp_list.parent) { |
803 | return thread__resolve_callchain(al->thread, cursor, evsel, sample, | 803 | return thread__resolve_callchain(al->thread, cursor, evsel, sample, |
804 | parent, al, max_stack); | 804 | parent, al, max_stack); |
805 | } | 805 | } |
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index ec76e6bef916..57b09791c339 100644 --- a/tools/perf/util/hist.h +++ b/tools/perf/util/hist.h | |||
@@ -242,6 +242,7 @@ struct perf_hpp_list { | |||
242 | struct list_head sorts; | 242 | struct list_head sorts; |
243 | 243 | ||
244 | int need_collapse; | 244 | int need_collapse; |
245 | int parent; | ||
245 | }; | 246 | }; |
246 | 247 | ||
247 | extern struct perf_hpp_list perf_hpp_list; | 248 | extern struct perf_hpp_list perf_hpp_list; |
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 9d0913107dc7..8c7bf4dbd479 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c | |||
@@ -1652,7 +1652,7 @@ static int add_callchain_ip(struct thread *thread, | |||
1652 | } | 1652 | } |
1653 | 1653 | ||
1654 | if (al.sym != NULL) { | 1654 | if (al.sym != NULL) { |
1655 | if (sort__has_parent && !*parent && | 1655 | if (perf_hpp_list.parent && !*parent && |
1656 | symbol__match_regex(al.sym, &parent_regex)) | 1656 | symbol__match_regex(al.sym, &parent_regex)) |
1657 | *parent = al.sym; | 1657 | *parent = al.sym; |
1658 | else if (have_ignore_callees && root_al && | 1658 | else if (have_ignore_callees && root_al && |
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index 64ace548dc88..75b33d387f50 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c | |||
@@ -21,7 +21,6 @@ const char *sort_order; | |||
21 | const char *field_order; | 21 | const char *field_order; |
22 | regex_t ignore_callees_regex; | 22 | regex_t ignore_callees_regex; |
23 | int have_ignore_callees = 0; | 23 | int have_ignore_callees = 0; |
24 | int sort__has_parent = 0; | ||
25 | int sort__has_sym = 0; | 24 | int sort__has_sym = 0; |
26 | int sort__has_dso = 0; | 25 | int sort__has_dso = 0; |
27 | int sort__has_socket = 0; | 26 | int sort__has_socket = 0; |
@@ -2244,7 +2243,7 @@ static int sort_dimension__add(struct perf_hpp_list *list, const char *tok, | |||
2244 | pr_err("Invalid regex: %s\n%s", parent_pattern, err); | 2243 | pr_err("Invalid regex: %s\n%s", parent_pattern, err); |
2245 | return -EINVAL; | 2244 | return -EINVAL; |
2246 | } | 2245 | } |
2247 | sort__has_parent = 1; | 2246 | list->parent = 1; |
2248 | } else if (sd->entry == &sort_sym) { | 2247 | } else if (sd->entry == &sort_sym) { |
2249 | sort__has_sym = 1; | 2248 | sort__has_sym = 1; |
2250 | /* | 2249 | /* |
@@ -2746,7 +2745,7 @@ int setup_sorting(struct perf_evlist *evlist) | |||
2746 | void reset_output_field(void) | 2745 | void reset_output_field(void) |
2747 | { | 2746 | { |
2748 | perf_hpp_list.need_collapse = 0; | 2747 | perf_hpp_list.need_collapse = 0; |
2749 | sort__has_parent = 0; | 2748 | perf_hpp_list.parent = 0; |
2750 | sort__has_sym = 0; | 2749 | sort__has_sym = 0; |
2751 | sort__has_dso = 0; | 2750 | sort__has_dso = 0; |
2752 | 2751 | ||
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h index 2e1d27326954..0e44aea86800 100644 --- a/tools/perf/util/sort.h +++ b/tools/perf/util/sort.h | |||
@@ -32,7 +32,6 @@ extern const char default_sort_order[]; | |||
32 | extern regex_t ignore_callees_regex; | 32 | extern regex_t ignore_callees_regex; |
33 | extern int have_ignore_callees; | 33 | extern int have_ignore_callees; |
34 | extern int sort__has_dso; | 34 | extern int sort__has_dso; |
35 | extern int sort__has_parent; | ||
36 | extern int sort__has_sym; | 35 | extern int sort__has_sym; |
37 | extern int sort__has_socket; | 36 | extern int sort__has_socket; |
38 | extern int sort__has_thread; | 37 | extern int sort__has_thread; |