Make symbol__new_unresolved() available through util/symbol.h
so it can be later used from builtin-c2c.
Signed-off-by: Artem Savkov <asavkov@redhat.com>
---
tools/perf/ui/browsers/hists.c | 22 ----------------------
tools/perf/util/symbol.c | 22 ++++++++++++++++++++++
tools/perf/util/symbol.h | 1 +
3 files changed, 23 insertions(+), 22 deletions(-)
@@ -2471,28 +2471,6 @@ do_annotate(struct hist_browser *browser, struct popup_action *act)
return 0;
}
-static struct symbol *symbol__new_unresolved(u64 addr, struct map *map)
-{
- struct annotated_source *src;
- struct symbol *sym;
- char name[64];
-
- snprintf(name, sizeof(name), "%.*" PRIx64, BITS_PER_LONG / 4, addr);
-
- sym = symbol__new(addr, ANNOTATION_DUMMY_LEN, 0, 0, name);
- if (sym) {
- src = symbol__hists(sym, 1);
- if (!src) {
- symbol__delete(sym);
- return NULL;
- }
-
- dso__insert_symbol(map__dso(map), sym);
- }
-
- return sym;
-}
-
static int
add_annotate_opt(struct hist_browser *browser __maybe_unused,
struct popup_action *act, char **optstr,
@@ -294,6 +294,28 @@ void maps__fixup_end(struct maps *maps)
up_write(maps__lock(maps));
}
+struct symbol *symbol__new_unresolved(u64 addr, struct map *map)
+{
+ struct annotated_source *src;
+ struct symbol *sym;
+ char name[64];
+
+ snprintf(name, sizeof(name), "%.*" PRIx64, BITS_PER_LONG / 4, addr);
+
+ sym = symbol__new(addr, ANNOTATION_DUMMY_LEN, 0, 0, name);
+ if (sym) {
+ src = symbol__hists(sym, 1);
+ if (!src) {
+ symbol__delete(sym);
+ return NULL;
+ }
+
+ dso__insert_symbol(map__dso(map), sym);
+ }
+
+ return sym;
+}
+
struct symbol *symbol__new(u64 start, u64 len, u8 binding, u8 type, const char *name)
{
size_t namelen = strlen(name) + 1;
@@ -176,6 +176,7 @@ void symbol__exit(void);
void symbol__elf_init(void);
int symbol__annotation_init(void);
+struct symbol *symbol__new_unresolved(u64 addr, struct map *map);
struct symbol *symbol__new(u64 start, u64 len, u8 binding, u8 type, const char *name);
size_t __symbol__fprintf_symname_offs(const struct symbol *sym,
const struct addr_location *al,