public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for David Miller <davem@davemloft.net>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org, hpa@zytor.com,
	mingo@kernel.org, tglx@linutronix.de, davem@davemloft.net
Subject: [tip:perf/urgent] perf symbols: Handle NULL dso in dso__name_len
Date: Sat, 31 Mar 2012 00:43:29 -0700	[thread overview]
Message-ID: <tip-1e2dd2f73afdc810cc7400b7036232fbdc416eeb@git.kernel.org> (raw)
In-Reply-To: <20120325.162822.2267799792062571623.davem@davemloft.net>

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;
 

      parent reply	other threads:[~2012-03-31  7:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-1e2dd2f73afdc810cc7400b7036232fbdc416eeb@git.kernel.org \
    --to=davem@davemloft.net \
    --cc=acme@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox