From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933964AbbI2Iq4 (ORCPT ); Tue, 29 Sep 2015 04:46:56 -0400 Received: from terminus.zytor.com ([198.137.202.10]:37890 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932895AbbI2Iqr (ORCPT ); Tue, 29 Sep 2015 04:46:47 -0400 Date: Tue, 29 Sep 2015 01:46:36 -0700 From: tip-bot for Adrian Hunter Message-ID: Cc: tglx@linutronix.de, mingo@kernel.org, linux-kernel@vger.kernel.org, acme@redhat.com, hpa@zytor.com, adrian.hunter@intel.com, jolsa@redhat.com Reply-To: hpa@zytor.com, acme@redhat.com, linux-kernel@vger.kernel.org, mingo@kernel.org, tglx@linutronix.de, jolsa@redhat.com, adrian.hunter@intel.com In-Reply-To: <1443186956-18718-17-git-send-email-adrian.hunter@intel.com> References: <1443186956-18718-17-git-send-email-adrian.hunter@intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf hists: Allow for max_stack greater than PERF_MAX_STACK_DEPTH Git-Commit-ID: 96b40f3c05f36e061fd4dde920b9e9c795a88b69 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 96b40f3c05f36e061fd4dde920b9e9c795a88b69 Gitweb: http://git.kernel.org/tip/96b40f3c05f36e061fd4dde920b9e9c795a88b69 Author: Adrian Hunter AuthorDate: Fri, 25 Sep 2015 16:15:47 +0300 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 28 Sep 2015 17:06:16 -0300 perf hists: Allow for max_stack greater than PERF_MAX_STACK_DEPTH Use the max_stack value instead of PERF_MAX_STACK_DEPTH so that arbitrary-sized callchains can be supported. Signed-off-by: Adrian Hunter Cc: Jiri Olsa Link: http://lkml.kernel.org/r/1443186956-18718-17-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/hist.c | 6 ++++-- tools/perf/util/hist.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index b3567a2..0cad9e0 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -695,7 +695,7 @@ iter_finish_normal_entry(struct hist_entry_iter *iter, } static int -iter_prepare_cumulative_entry(struct hist_entry_iter *iter __maybe_unused, +iter_prepare_cumulative_entry(struct hist_entry_iter *iter, struct addr_location *al __maybe_unused) { struct hist_entry **he_cache; @@ -707,7 +707,7 @@ iter_prepare_cumulative_entry(struct hist_entry_iter *iter __maybe_unused, * cumulated only one time to prevent entries more than 100% * overhead. */ - he_cache = malloc(sizeof(*he_cache) * (PERF_MAX_STACK_DEPTH + 1)); + he_cache = malloc(sizeof(*he_cache) * (iter->max_stack + 1)); if (he_cache == NULL) return -ENOMEM; @@ -868,6 +868,8 @@ int hist_entry_iter__add(struct hist_entry_iter *iter, struct addr_location *al, if (err) return err; + iter->max_stack = max_stack_depth; + err = iter->ops->prepare_entry(iter, al); if (err) goto out; diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index 4d6aa1d..8c20a8f 100644 --- a/tools/perf/util/hist.h +++ b/tools/perf/util/hist.h @@ -90,6 +90,7 @@ struct hist_entry_iter { int curr; bool hide_unresolved; + int max_stack; struct perf_evsel *evsel; struct perf_sample *sample;