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

* Re: [PATCH 4/5] perf: Handle NULL dso in dso__name_len
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-03-27 14:01 UTC (permalink / raw)
  To: David Miller; +Cc: linux-kernel

Em Sun, Mar 25, 2012 at 04:28:22PM -0400, David Miller escreveu:
> 
> 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

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

* [tip:perf/urgent] perf symbols: Handle NULL dso in dso__name_len
  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-bot for David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for David Miller @ 2012-03-31  7:43 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: acme, linux-kernel, hpa, mingo, tglx, davem

Commit-ID:  1e2dd2f73afdc810cc7400b7036232fbdc416eeb
Gitweb:     http://git.kernel.org/tip/1e2dd2f73afdc810cc7400b7036232fbdc416eeb
Author:     David Miller <davem@davemloft.net>
AuthorDate: Sun, 25 Mar 2012 16:28:22 -0400
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
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().

Signed-off-by: David S. Miller <davem@davemloft.net>
Link: http://lkml.kernel.org/r/20120325.162822.2267799792062571623.davem@davemloft.net
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 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 d9e995b..c0a028c 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -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;
 

^ 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.