Skip to content

Commit 0258fa8

Browse files
acmelgregkh
authored andcommitted
perf symbols: Fix dso__fprintf_symbols_by_name() to return the number of printed chars
[ Upstream commit 210e4c8 ] The 'ret' variable was initialized to zero but then it was not updated from the fprintf() return, fix it. Reported-by: Yang Li <yang.lee@linux.alibaba.com> cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> cc: Ingo Molnar <mingo@redhat.com> cc: Jiri Olsa <jolsa@redhat.com> cc: Mark Rutland <mark.rutland@arm.com> cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Fixes: 90f18e6 ("perf symbols: List symbols in a dso in ascending name order") Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent d4911e7 commit 0258fa8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎tools/perf/util/symbol_fprintf.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ size_t dso__fprintf_symbols_by_name(struct dso *dso,
6868

6969
for (nd = rb_first_cached(&dso->symbol_names); nd; nd = rb_next(nd)) {
7070
pos = rb_entry(nd, struct symbol_name_rb_node, rb_node);
71-
fprintf(fp, "%s\n", pos->sym.name);
71+
ret += fprintf(fp, "%s\n", pos->sym.name);
7272
}
7373

7474
return ret;

0 commit comments

Comments
 (0)