All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/5] perf: Handle NULL dso in dso__name_len
@ 2012-03-25 20:28 David Miller
  2012-03-27 14:01 ` Arnaldo Carvalho de Melo
  2012-03-31  7:43 ` [tip:perf/urgent] perf symbols: " tip-bot for David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: David Miller @ 2012-03-25 20:28 UTC (permalink / raw)
  To: acme; +Cc: linux-kernel


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().

Signed-off-by: David S. Miller <davem@davemloft.net>
---
 tools/perf/util/symbol.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 5dd83c3..472b467 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -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;
 
-- 
1.7.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-03-31  7:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-25 20:28 [PATCH 4/5] perf: Handle NULL dso in dso__name_len David Miller
2012-03-27 14:01 ` Arnaldo Carvalho de Melo
2012-03-31  7:43 ` [tip:perf/urgent] perf symbols: " tip-bot for David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.