Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756906Ab1CAREE (ORCPT ); Tue, 1 Mar 2011 12:04:04 -0500 Received: from bombadil.infradead.org ([18.85.46.34]:58309 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756232Ab1CAREB (ORCPT ); Tue, 1 Mar 2011 12:04:01 -0500 From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Frederic Weisbecker , Ingo Molnar , Mike Galbraith , Paul Mackerras , Peter Zijlstra , Stephane Eranian , Tom Zanussi Subject: [PATCH 3/6] perf top browser: Handle empty active symbols list Date: Tue, 1 Mar 2011 14:03:44 -0300 Message-Id: <1298999027-30673-4-git-send-email-acme@infradead.org> X-Mailer: git-send-email 1.6.2.5 In-Reply-To: <1298999027-30673-1-git-send-email-acme@infradead.org> References: <1298999027-30673-1-git-send-email-acme@infradead.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by canuck.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1555 Lines: 43 From: Arnaldo Carvalho de Melo Fixing a SEGV. An empty list could happen when not being able to resolve symbols, for instance when --vmlinux invalid-file is used. Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: Mike Galbraith Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Tom Zanussi LKML-Reference: Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/ui/browsers/top.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/tools/perf/util/ui/browsers/top.c b/tools/perf/util/ui/browsers/top.c index e9381ec..5a06538 100644 --- a/tools/perf/util/ui/browsers/top.c +++ b/tools/perf/util/ui/browsers/top.c @@ -76,6 +76,12 @@ static void perf_top_browser__update_rb_tree(struct perf_top_browser *browser) browser->root = RB_ROOT; browser->b.top = NULL; browser->sum_ksamples = perf_top__decay_samples(top, &browser->root); + /* + * No active symbols + */ + if (top->rb_entries == 0) + return; + perf_top__find_widths(top, &browser->root, &browser->dso_width, &browser->dso_short_width, &browser->sym_width); -- 1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/