perf: Handle NULL dso in dso__name_len
PATCH 4/5 perf: Handle NULL dso in dso__name_len
We should use "[unknown]" in this case, in concert with the code in _hist_entry__dso_snprintf().
Otherwise we'll crash when recomputing the histogram column lengths in hists__calc_col_len().
--- tools/perf/util/symbol.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
tools/perf/util/symbol.c +2 -0
@@ -51,6 +51,8 @@ struct symbol_conf symbol_conf = {int dso__name_len (const struct dso *dso) { +if (!dso) +return strlen ("[unknown]" );if (verbose)return dso->long_name_len;
Signature · 1 line
1.7.9.1
Arnaldo Carvalho de Melo
AppliedEm Sun, Mar 25, 2012 at 04:28:22PM -0400, David Miller escreveu:
Quoted 6 lines
We should use "[unknown]" in this case, in concert with the code in
_hist_entry__dso_snprintf().Otherwise we'll crash when recomputing the histogram column lengths in
hists__calc_col_len().
Thanks, applied.
- Arnaldo
[tip:perf/urgent] perf symbols: Handle NULL dso in dso__name_len
In reply to David MillerCommit-ID: 1e2dd2f73afdc810cc7400b7036232fbdc416eeb Gitweb: http://git.kernel.org/tip/1e2dd2f73afdc810cc7400b7036232fbdc416eeb Author: David Miller <[email protected]> AuthorDate: Sun, 25 Mar 2012 16:28:22 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 27 Mar 2012 11:00:58 -0300
perf symbols: Handle NULL dso in dso__name_len
We should use "[unknown]" in this case, in concert with the code in _hist_entry__dso_snprintf().
Otherwise we'll crash when recomputing the histogram column lengths in hists__calc_col_len().
--- tools/perf/util/symbol.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
tools/perf/util/symbol.c +2 -0
@@ -50,6 +50,8 @@ struct symbol_conf symbol_conf = {int dso__name_len (const struct dso *dso) { +if (!dso) +return strlen ("[unknown]" );if (verbose)return dso->long_name_len;