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

perf evsel: Remove need for symbol_conf in evsel_fprintf.c

So that we an later link it to the python binding without having to
drag the symbol object files.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-8823tveyasocnuoelq4qopwf@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+16 -15
+1 -1
tools/perf/builtin-sched.c
··· 2055 2055 EVSEL__PRINT_SYM | EVSEL__PRINT_ONELINE | 2056 2056 EVSEL__PRINT_CALLCHAIN_ARROW | 2057 2057 EVSEL__PRINT_SKIP_IGNORED, 2058 - &callchain_cursor, stdout); 2058 + &callchain_cursor, symbol_conf.bt_stop_list, stdout); 2059 2059 2060 2060 out: 2061 2061 printf("\n");
+4 -2
tools/perf/builtin-script.c
··· 1325 1325 } else 1326 1326 printed += fprintf(fp, "\n"); 1327 1327 1328 - printed += sample__fprintf_sym(sample, al, 0, print_opts, cursor, fp); 1328 + printed += sample__fprintf_sym(sample, al, 0, print_opts, cursor, 1329 + symbol_conf.bt_stop_list, fp); 1329 1330 } 1330 1331 1331 1332 /* print branch_to information */ ··· 1868 1867 cursor = &callchain_cursor; 1869 1868 1870 1869 fputc(cursor ? '\n' : ' ', fp); 1871 - sample__fprintf_sym(sample, al, 0, output[type].print_ip_opts, cursor, fp); 1870 + sample__fprintf_sym(sample, al, 0, output[type].print_ip_opts, cursor, 1871 + symbol_conf.bt_stop_list, fp); 1872 1872 } 1873 1873 1874 1874 if (PRINT_FIELD(IREGS))
+1 -1
tools/perf/builtin-trace.c
··· 2076 2076 EVSEL__PRINT_DSO | 2077 2077 EVSEL__PRINT_UNKNOWN_AS_ADDR; 2078 2078 2079 - return sample__fprintf_callchain(sample, 38, print_opts, &callchain_cursor, trace->output); 2079 + return sample__fprintf_callchain(sample, 38, print_opts, &callchain_cursor, symbol_conf.bt_stop_list, trace->output); 2080 2080 } 2081 2081 2082 2082 static const char *errno_to_name(struct evsel *evsel, int err)
+4 -3
tools/perf/util/evsel.h
··· 428 428 struct callchain_cursor; 429 429 430 430 int sample__fprintf_callchain(struct perf_sample *sample, int left_alignment, 431 - unsigned int print_opts, 432 - struct callchain_cursor *cursor, FILE *fp); 431 + unsigned int print_opts, struct callchain_cursor *cursor, 432 + struct strlist *bt_stop_list, FILE *fp); 433 433 434 434 int sample__fprintf_sym(struct perf_sample *sample, struct addr_location *al, 435 435 int left_alignment, unsigned int print_opts, 436 - struct callchain_cursor *cursor, FILE *fp); 436 + struct callchain_cursor *cursor, 437 + struct strlist *bt_stop_list, FILE *fp); 437 438 438 439 bool perf_evsel__fallback(struct evsel *evsel, int err, 439 440 char *msg, size_t msgsize);
+6 -8
tools/perf/util/evsel_fprintf.c
··· 102 102 103 103 int sample__fprintf_callchain(struct perf_sample *sample, int left_alignment, 104 104 unsigned int print_opts, struct callchain_cursor *cursor, 105 - FILE *fp) 105 + struct strlist *bt_stop_list, FILE *fp) 106 106 { 107 107 int printed = 0; 108 108 struct callchain_cursor_node *node; ··· 175 175 printed += fprintf(fp, "\n"); 176 176 177 177 /* Add srccode here too? */ 178 - if (symbol_conf.bt_stop_list && 179 - node->sym && 180 - strlist__has_entry(symbol_conf.bt_stop_list, 181 - node->sym->name)) { 178 + if (bt_stop_list && node->sym && 179 + strlist__has_entry(bt_stop_list, node->sym->name)) { 182 180 break; 183 181 } 184 182 ··· 191 193 192 194 int sample__fprintf_sym(struct perf_sample *sample, struct addr_location *al, 193 195 int left_alignment, unsigned int print_opts, 194 - struct callchain_cursor *cursor, FILE *fp) 196 + struct callchain_cursor *cursor, struct strlist *bt_stop_list, FILE *fp) 195 197 { 196 198 int printed = 0; 197 199 int print_ip = print_opts & EVSEL__PRINT_IP; ··· 202 204 int print_unknown_as_addr = print_opts & EVSEL__PRINT_UNKNOWN_AS_ADDR; 203 205 204 206 if (cursor != NULL) { 205 - printed += sample__fprintf_callchain(sample, left_alignment, 206 - print_opts, cursor, fp); 207 + printed += sample__fprintf_callchain(sample, left_alignment, print_opts, 208 + cursor, bt_stop_list, fp); 207 209 } else { 208 210 printed += fprintf(fp, "%-*.*s", left_alignment, left_alignment, " "); 209 211