diff options
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/annotate.c | 25 | ||||
-rw-r--r-- | tools/perf/util/annotate.h | 5 |
2 files changed, 20 insertions, 10 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index db475e44f42f..a984bdae7811 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -55,14 +55,6 @@ #include <linux/ctype.h> -struct annotation_options annotation__default_options = { - .use_offset = true, - .jump_arrows = true, - .annotate_src = true, - .offset_level = ANNOTATION__OFFSET_JUMP_TARGETS, - .percent_type = PERCENT_PERIOD_LOCAL, -}; - static regex_t file_lineno; static struct ins_ops *ins__find(struct arch *arch, const char *name); @@ -3226,6 +3218,23 @@ static int annotation__config(const char *var, const char *value, void *data) return 0; } +void annotation_options__init(struct annotation_options *opt) +{ + memset(opt, 0, sizeof(*opt)); + + /* Default values. */ + opt->use_offset = true; + opt->jump_arrows = true; + opt->annotate_src = true; + opt->offset_level = ANNOTATION__OFFSET_JUMP_TARGETS; + opt->percent_type = PERCENT_PERIOD_LOCAL; +} + + +void annotation_options__exit(struct annotation_options *opt __maybe_unused) +{ +} + void annotation_config__init(struct annotation_options *opt) { perf_config(annotation__config, opt); diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index 8934072c39e6..e7238c694465 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h @@ -109,8 +109,6 @@ enum { #define ANNOTATION__MIN_OFFSET_LEVEL ANNOTATION__OFFSET_JUMP_TARGETS -extern struct annotation_options annotation__default_options; - struct annotation; struct sym_hist_entry { @@ -418,6 +416,9 @@ static inline int symbol__tui_annotate(struct map_symbol *ms __maybe_unused, } #endif +void annotation_options__init(struct annotation_options *opt); +void annotation_options__exit(struct annotation_options *opt); + void annotation_config__init(struct annotation_options *opt); int annotate_parse_percent_type(const struct option *opt, const char *_str, |