From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753626Ab2IZH4M (ORCPT ); Wed, 26 Sep 2012 03:56:12 -0400 Received: from LGEMRELSE6Q.lge.com ([156.147.1.121]:55720 "EHLO LGEMRELSE6Q.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753412Ab2IZH4H (ORCPT ); Wed, 26 Sep 2012 03:56:07 -0400 X-AuditID: 9c930179-b7bf9ae000000e4c-35-5062b514629e From: Namhyung Kim To: Arnaldo Carvalho de Melo Cc: Peter Zijlstra , Paul Mackerras , Ingo Molnar , LKML , Jiri Olsa , Stephane Eranian , David Ahern , Namhyung Kim , Arun Sharma , Frederic Weisbecker Subject: [PATCH 03/16] perf hists: Move he->stat.nr_events initialization to a template Date: Wed, 26 Sep 2012 16:47:30 +0900 Message-Id: <1348645663-25303-4-git-send-email-namhyung@kernel.org> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1348645663-25303-1-git-send-email-namhyung@kernel.org> References: <1348645663-25303-1-git-send-email-namhyung@kernel.org> X-Brightmail-Tracker: AAAAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Namhyung Kim Since it is set to 1 for a new hist entry, no need to set to separately. Move it to a template entry. Cc: Jiri Olsa Cc: Arun Sharma Cc: Stephane Eranian Cc: Frederic Weisbecker Signed-off-by: Namhyung Kim --- tools/perf/util/hist.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index ab3d11491991..ef39e6714cbb 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -223,7 +223,7 @@ static struct hist_entry *hist_entry__new(struct hist_entry *template) if (he != NULL) { *he = *template; - he->stat.nr_events = 1; + if (he->ms.map) he->ms.map->referenced = true; if (symbol_conf.use_callchain) @@ -323,6 +323,7 @@ struct hist_entry *__hists__add_branch_entry(struct hists *self, .level = al->level, .stat = { .period = period, + .nr_events = 1, }, .parent = sym_parent, .filtered = symbol__parent_filter(sym_parent), @@ -347,6 +348,7 @@ struct hist_entry *__hists__add_entry(struct hists *self, .level = al->level, .stat = { .period = period, + .nr_events = 1, }, .parent = sym_parent, .filtered = symbol__parent_filter(sym_parent), -- 1.7.11.4