]> git.itanic.dy.fi Git - linux-stable/commitdiff
perf symbols: Add dso__find_symbol_nocache()
authorAdrian Hunter <adrian.hunter@intel.com>
Fri, 20 Jan 2023 12:34:50 +0000 (14:34 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Sun, 22 Jan 2023 21:10:12 +0000 (18:10 -0300)
Symbols should not be cached when there are more symbols still to add.

Add dso__find_symbol_nocache() to facilitate that.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20230120123456.12449-5-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/symbol.c
tools/perf/util/symbol.h

index a3a165ae933adcab6580e1671b9dd2f04376c7f6..a024f06f75d87396a5f7384ec5eeb024ceeecde4 100644 (file)
@@ -556,6 +556,11 @@ struct symbol *dso__find_symbol(struct dso *dso, u64 addr)
        return dso->last_find_result.symbol;
 }
 
+struct symbol *dso__find_symbol_nocache(struct dso *dso, u64 addr)
+{
+       return symbols__find(&dso->symbols, addr);
+}
+
 struct symbol *dso__first_symbol(struct dso *dso)
 {
        return symbols__first(&dso->symbols);
index f735108c4d4ecfd9480af24aa512d6eca8a5791e..2fdeb22bd02f7735c3c31868f5d7847893eba8e4 100644 (file)
@@ -148,6 +148,7 @@ void dso__delete_symbol(struct dso *dso,
                        struct symbol *sym);
 
 struct symbol *dso__find_symbol(struct dso *dso, u64 addr);
+struct symbol *dso__find_symbol_nocache(struct dso *dso, u64 addr);
 struct symbol *dso__find_symbol_by_name(struct dso *dso, const char *name);
 
 struct symbol *symbol__next_by_name(struct symbol *sym);