Skip to content

Commit

Permalink
perf symbols: Fix dso__fprintf_symbols_by_name() to return the number…
Browse files Browse the repository at this point in the history
… of printed chars

[ Upstream commit 210e4c89ef61432040c6cd828fefa441f4887186 ]

The 'ret' variable was initialized to zero but then it was not updated
from the fprintf() return, fix it.

Reported-by: Yang Li <[email protected]>
cc: Alexander Shishkin <[email protected]>
cc: Ingo Molnar <[email protected]>
cc: Jiri Olsa <[email protected]>
cc: Mark Rutland <[email protected]>
cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Srikar Dronamraju <[email protected]>
Fixes: 90f18e6 ("perf symbols: List symbols in a dso in ascending name order")
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
acmel authored and gregkh committed May 22, 2021
1 parent 878177b commit eda1827
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/perf/util/symbol_fprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ size_t dso__fprintf_symbols_by_name(struct dso *dso,

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

return ret;
Expand Down

0 comments on commit eda1827

Please sign in to comment.