aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/annotate.c
diff options
context:
space:
mode:
authorNamhyung Kim <[email protected]>2023-11-28 17:54:39 +0000
committerArnaldo Carvalho de Melo <[email protected]>2023-12-07 20:18:24 +0000
commit7f929aea21fd0be5e0d9ee5827d5b809daa69f29 (patch)
tree0ad972fea7ee9e973e9acfb762a5bb428b71168f /tools/perf/util/annotate.c
parentperf ui/browser/annotate: Use global annotation_options (diff)
downloadkernel-7f929aea21fd0be5e0d9ee5827d5b809daa69f29.tar.gz
kernel-7f929aea21fd0be5e0d9ee5827d5b809daa69f29.zip
perf annotate: Ensure init/exit for global options
Now it only cares about the global options so it can just handle it without the argument. Reviewed-by: Ian Rogers <[email protected]> Signed-off-by: Namhyung Kim <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/util/annotate.c')
-rw-r--r--tools/perf/util/annotate.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index daff9af552f4..626ff3baeb85 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -3416,8 +3416,10 @@ static int annotation__config(const char *var, const char *value, void *data)
return 0;
}
-void annotation_options__init(struct annotation_options *opt)
+void annotation_options__init(void)
{
+ struct annotation_options *opt = &annotate_opts;
+
memset(opt, 0, sizeof(*opt));
/* Default values. */
@@ -3428,16 +3430,15 @@ void annotation_options__init(struct annotation_options *opt)
opt->percent_type = PERCENT_PERIOD_LOCAL;
}
-
-void annotation_options__exit(struct annotation_options *opt)
+void annotation_options__exit(void)
{
- zfree(&opt->disassembler_style);
- zfree(&opt->objdump_path);
+ zfree(&annotate_opts.disassembler_style);
+ zfree(&annotate_opts.objdump_path);
}
-void annotation_config__init(struct annotation_options *opt)
+void annotation_config__init(void)
{
- perf_config(annotation__config, opt);
+ perf_config(annotation__config, &annotate_opts);
}
static unsigned int parse_percent_type(char *str1, char *str2)
@@ -3491,8 +3492,10 @@ out:
return err;
}
-int annotate_check_args(struct annotation_options *args)
+int annotate_check_args(void)
{
+ struct annotation_options *args = &annotate_opts;
+
if (args->prefix_strip && !args->prefix) {
pr_err("--prefix-strip requires --prefix\n");
return -1;