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.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 32ff3fec
...@@ -2055,7 +2055,7 @@ static void timehist_print_sample(struct perf_sched *sched, ...@@ -2055,7 +2055,7 @@ static void timehist_print_sample(struct perf_sched *sched,
EVSEL__PRINT_SYM | EVSEL__PRINT_ONELINE | EVSEL__PRINT_SYM | EVSEL__PRINT_ONELINE |
EVSEL__PRINT_CALLCHAIN_ARROW | EVSEL__PRINT_CALLCHAIN_ARROW |
EVSEL__PRINT_SKIP_IGNORED, EVSEL__PRINT_SKIP_IGNORED,
&callchain_cursor, stdout); &callchain_cursor, symbol_conf.bt_stop_list, stdout);
out: out:
printf("\n"); printf("\n");
......
...@@ -1325,7 +1325,8 @@ static int perf_sample__fprintf_bts(struct perf_sample *sample, ...@@ -1325,7 +1325,8 @@ static int perf_sample__fprintf_bts(struct perf_sample *sample,
} else } else
printed += fprintf(fp, "\n"); printed += fprintf(fp, "\n");
printed += sample__fprintf_sym(sample, al, 0, print_opts, cursor, fp); printed += sample__fprintf_sym(sample, al, 0, print_opts, cursor,
symbol_conf.bt_stop_list, fp);
} }
/* print branch_to information */ /* print branch_to information */
...@@ -1867,7 +1868,8 @@ static void process_event(struct perf_script *script, ...@@ -1867,7 +1868,8 @@ static void process_event(struct perf_script *script,
cursor = &callchain_cursor; cursor = &callchain_cursor;
fputc(cursor ? '\n' : ' ', fp); fputc(cursor ? '\n' : ' ', fp);
sample__fprintf_sym(sample, al, 0, output[type].print_ip_opts, cursor, fp); sample__fprintf_sym(sample, al, 0, output[type].print_ip_opts, cursor,
symbol_conf.bt_stop_list, fp);
} }
if (PRINT_FIELD(IREGS)) if (PRINT_FIELD(IREGS))
......
...@@ -2076,7 +2076,7 @@ static int trace__fprintf_callchain(struct trace *trace, struct perf_sample *sam ...@@ -2076,7 +2076,7 @@ static int trace__fprintf_callchain(struct trace *trace, struct perf_sample *sam
EVSEL__PRINT_DSO | EVSEL__PRINT_DSO |
EVSEL__PRINT_UNKNOWN_AS_ADDR; EVSEL__PRINT_UNKNOWN_AS_ADDR;
return sample__fprintf_callchain(sample, 38, print_opts, &callchain_cursor, trace->output); return sample__fprintf_callchain(sample, 38, print_opts, &callchain_cursor, symbol_conf.bt_stop_list, trace->output);
} }
static const char *errno_to_name(struct evsel *evsel, int err) static const char *errno_to_name(struct evsel *evsel, int err)
......
...@@ -428,12 +428,13 @@ int perf_evsel__fprintf(struct evsel *evsel, ...@@ -428,12 +428,13 @@ int perf_evsel__fprintf(struct evsel *evsel,
struct callchain_cursor; struct callchain_cursor;
int sample__fprintf_callchain(struct perf_sample *sample, int left_alignment, int sample__fprintf_callchain(struct perf_sample *sample, int left_alignment,
unsigned int print_opts, unsigned int print_opts, struct callchain_cursor *cursor,
struct callchain_cursor *cursor, FILE *fp); struct strlist *bt_stop_list, FILE *fp);
int sample__fprintf_sym(struct perf_sample *sample, struct addr_location *al, int sample__fprintf_sym(struct perf_sample *sample, struct addr_location *al,
int left_alignment, unsigned int print_opts, int left_alignment, unsigned int print_opts,
struct callchain_cursor *cursor, FILE *fp); struct callchain_cursor *cursor,
struct strlist *bt_stop_list, FILE *fp);
bool perf_evsel__fallback(struct evsel *evsel, int err, bool perf_evsel__fallback(struct evsel *evsel, int err,
char *msg, size_t msgsize); char *msg, size_t msgsize);
......
...@@ -102,7 +102,7 @@ int perf_evsel__fprintf(struct evsel *evsel, ...@@ -102,7 +102,7 @@ int perf_evsel__fprintf(struct evsel *evsel,
int sample__fprintf_callchain(struct perf_sample *sample, int left_alignment, int sample__fprintf_callchain(struct perf_sample *sample, int left_alignment,
unsigned int print_opts, struct callchain_cursor *cursor, unsigned int print_opts, struct callchain_cursor *cursor,
FILE *fp) struct strlist *bt_stop_list, FILE *fp)
{ {
int printed = 0; int printed = 0;
struct callchain_cursor_node *node; struct callchain_cursor_node *node;
...@@ -175,10 +175,8 @@ int sample__fprintf_callchain(struct perf_sample *sample, int left_alignment, ...@@ -175,10 +175,8 @@ int sample__fprintf_callchain(struct perf_sample *sample, int left_alignment,
printed += fprintf(fp, "\n"); printed += fprintf(fp, "\n");
/* Add srccode here too? */ /* Add srccode here too? */
if (symbol_conf.bt_stop_list && if (bt_stop_list && node->sym &&
node->sym && strlist__has_entry(bt_stop_list, node->sym->name)) {
strlist__has_entry(symbol_conf.bt_stop_list,
node->sym->name)) {
break; break;
} }
...@@ -193,7 +191,7 @@ int sample__fprintf_callchain(struct perf_sample *sample, int left_alignment, ...@@ -193,7 +191,7 @@ int sample__fprintf_callchain(struct perf_sample *sample, int left_alignment,
int sample__fprintf_sym(struct perf_sample *sample, struct addr_location *al, int sample__fprintf_sym(struct perf_sample *sample, struct addr_location *al,
int left_alignment, unsigned int print_opts, int left_alignment, unsigned int print_opts,
struct callchain_cursor *cursor, FILE *fp) struct callchain_cursor *cursor, struct strlist *bt_stop_list, FILE *fp)
{ {
int printed = 0; int printed = 0;
int print_ip = print_opts & EVSEL__PRINT_IP; int print_ip = print_opts & EVSEL__PRINT_IP;
...@@ -204,8 +202,8 @@ int sample__fprintf_sym(struct perf_sample *sample, struct addr_location *al, ...@@ -204,8 +202,8 @@ int sample__fprintf_sym(struct perf_sample *sample, struct addr_location *al,
int print_unknown_as_addr = print_opts & EVSEL__PRINT_UNKNOWN_AS_ADDR; int print_unknown_as_addr = print_opts & EVSEL__PRINT_UNKNOWN_AS_ADDR;
if (cursor != NULL) { if (cursor != NULL) {
printed += sample__fprintf_callchain(sample, left_alignment, printed += sample__fprintf_callchain(sample, left_alignment, print_opts,
print_opts, cursor, fp); cursor, bt_stop_list, fp);
} else { } else {
printed += fprintf(fp, "%-*.*s", left_alignment, left_alignment, " "); printed += fprintf(fp, "%-*.*s", left_alignment, left_alignment, " ");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment