Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754142AbcDVOqo (ORCPT ); Fri, 22 Apr 2016 10:46:44 -0400 Received: from mga01.intel.com ([192.55.52.88]:17012 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751761AbcDVOqn (ORCPT ); Fri, 22 Apr 2016 10:46:43 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,517,1455004800"; d="scan'208";a="960639684" From: kan.liang@intel.com To: acme@kernel.org Cc: namhyung@kernel.org, jolsa@kernel.org, ak@linux.intel.com, linux-kernel@vger.kernel.org, Kan Liang Subject: [PATCH 1/1] perf hists: clear dummy entry accumulated period Date: Fri, 22 Apr 2016 00:20:56 -0700 Message-Id: <1461309656-39737-1-git-send-email-kan.liang@intel.com> X-Mailer: git-send-email 2.5.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1661 Lines: 50 From: Kan Liang The accumulated period for dummy entry should also be 0. Otherwise, the total overhead could be overcounted. [perf]$ perf record -e '{LLC-load-misses,cpu/instructions/}' --call-graph=lbr ./tchain [perf]$ perf report --stdio # To display the perf.data header info, please use --header/--header-only options. # # # Total Lost Samples: 0 # # Samples: 21K of event 'anon group { LLC-load-misses, cpu/instructions/ }' # Event count (approx.): 16313667937 # # Children Self Command Shared Object Symbol # ................ ................ ........... ................ ............................ # 4769.98% 0.01% 0.00% 0.01% tchain_edit [kernel.vmlinux] [k] update_fast_timekeeper 4356.18% 0.01% 0.00% 0.01% tchain_edit [kernel.vmlinux] [k] trigger_load_balance 3181.12% 0.01% 0.00% 0.01% tchain_edit [kernel.vmlinux] [k] irq_work_tick 1592.37% 0.00% 0.00% 0.00% tchain_edit [kernel.vmlinux] [k] cpu_needs_another_gp Signed-off-by: Kan Liang --- tools/perf/util/hist.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 991a351..657d1ca 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -2062,6 +2062,7 @@ static struct hist_entry *hists__add_dummy_entry(struct hists *hists, if (he) { memset(&he->stat, 0, sizeof(he->stat)); he->hists = hists; + memset(he->stat_acc, 0, sizeof(he->stat)); rb_link_node(&he->rb_node_in, parent, p); rb_insert_color(&he->rb_node_in, root); hists__inc_stats(hists, he); -- 2.5.0