Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jiri Olsa and committed by
Arnaldo Carvalho de Melo
de7e6a7c 52225036

+6 -7
+1 -1
tools/perf/builtin-report.c
··· 234 234 sample_type |= PERF_SAMPLE_BRANCH_STACK; 235 235 236 236 if (!is_pipe && !(sample_type & PERF_SAMPLE_CALLCHAIN)) { 237 - if (sort__has_parent) { 237 + if (perf_hpp_list.parent) { 238 238 ui__error("Selected --sort parent, but no " 239 239 "callchain data. Did you call " 240 240 "'perf record' without -g?\n");
+1 -1
tools/perf/util/callchain.c
··· 799 799 return 0; 800 800 801 801 if (symbol_conf.use_callchain || symbol_conf.cumulate_callchain || 802 - sort__has_parent) { 802 + perf_hpp_list.parent) { 803 803 return thread__resolve_callchain(al->thread, cursor, evsel, sample, 804 804 parent, al, max_stack); 805 805 }
+1
tools/perf/util/hist.h
··· 242 242 struct list_head sorts; 243 243 244 244 int need_collapse; 245 + int parent; 245 246 }; 246 247 247 248 extern struct perf_hpp_list perf_hpp_list;
+1 -1
tools/perf/util/machine.c
··· 1652 1652 } 1653 1653 1654 1654 if (al.sym != NULL) { 1655 - if (sort__has_parent && !*parent && 1655 + if (perf_hpp_list.parent && !*parent && 1656 1656 symbol__match_regex(al.sym, &parent_regex)) 1657 1657 *parent = al.sym; 1658 1658 else if (have_ignore_callees && root_al &&
+2 -3
tools/perf/util/sort.c
··· 21 21 const char *field_order; 22 22 regex_t ignore_callees_regex; 23 23 int have_ignore_callees = 0; 24 - int sort__has_parent = 0; 25 24 int sort__has_sym = 0; 26 25 int sort__has_dso = 0; 27 26 int sort__has_socket = 0; ··· 2243 2244 pr_err("Invalid regex: %s\n%s", parent_pattern, err); 2244 2245 return -EINVAL; 2245 2246 } 2246 - sort__has_parent = 1; 2247 + list->parent = 1; 2247 2248 } else if (sd->entry == &sort_sym) { 2248 2249 sort__has_sym = 1; 2249 2250 /* ··· 2745 2746 void reset_output_field(void) 2746 2747 { 2747 2748 perf_hpp_list.need_collapse = 0; 2748 - sort__has_parent = 0; 2749 + perf_hpp_list.parent = 0; 2749 2750 sort__has_sym = 0; 2750 2751 sort__has_dso = 0; 2751 2752
-1
tools/perf/util/sort.h
··· 32 32 extern regex_t ignore_callees_regex; 33 33 extern int have_ignore_callees; 34 34 extern int sort__has_dso; 35 - extern int sort__has_parent; 36 35 extern int sort__has_sym; 37 36 extern int sort__has_socket; 38 37 extern int sort__has_thread;