diff options
Diffstat (limited to 'tools/perf/util/symbol.c')
-rw-r--r-- | tools/perf/util/symbol.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 0975438c3e7..b580fa82911 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -263,6 +263,18 @@ static size_t symbol__fprintf(struct symbol *sym, FILE *fp) sym->name); } +size_t symbol__fprintf_symname(const struct symbol *sym, FILE *fp) +{ + const char *symname; + + if (sym && sym->name) + symname = sym->name; + else + symname = "[unknown]"; + + return fprintf(fp, "%s", symname); +} + void dso__set_long_name(struct dso *dso, char *name) { if (name == NULL) |