From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754899Ab2GRRLd (ORCPT ); Wed, 18 Jul 2012 13:11:33 -0400 Received: from mail-yw0-f46.google.com ([209.85.213.46]:44953 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754085Ab2GRRLF (ORCPT ); Wed, 18 Jul 2012 13:11:05 -0400 From: Frederic Weisbecker To: Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra Cc: LKML , Frederic Weisbecker , David Ahern , Jiri Olsa , Namhyung Kim Subject: [PATCH 2/3] perf tools: Return correct number of characters printed in callchain Date: Wed, 18 Jul 2012 19:10:55 +0200 Message-Id: <1342631456-7233-2-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1342631456-7233-1-git-send-email-fweisbec@gmail.com> References: <1342631456-7233-1-git-send-email-fweisbec@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Include the omitted number of characters printed for the first entry. Not that it really matters because nobody seem to care about the number of printed characters for now. But just in case. Signed-off-by: Frederic Weisbecker Cc: Arnaldo Carvalho de Melo Cc: David Ahern Cc: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra --- tools/perf/util/hist.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 514e2a4..90dc35a 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -708,7 +708,7 @@ static size_t callchain__fprintf_graph(FILE *fp, struct rb_root *root, bool printed = false; struct rb_node *node; int i = 0; - int ret; + int ret = 0; /* * If have one single callchain root, don't bother printing @@ -747,8 +747,9 @@ static size_t callchain__fprintf_graph(FILE *fp, struct rb_root *root, root = &cnode->rb_root; } - return __callchain__fprintf_graph(fp, root, total_samples, + ret += __callchain__fprintf_graph(fp, root, total_samples, 1, 1, left_margin); + return ret; } static size_t __callchain__fprintf_flat(FILE *fp, -- 1.7.5.4