From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752913AbbGRP0P (ORCPT ); Sat, 18 Jul 2015 11:26:15 -0400 Received: from mga11.intel.com ([192.55.52.93]:34663 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752238AbbGRPY7 (ORCPT ); Sat, 18 Jul 2015 11:24:59 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,499,1432623600"; d="scan'208";a="766909046" From: Andi Kleen To: acme@kernel.org Cc: jolsa@kernel.org, linux-kernel@vger.kernel.org, namhyung@kernel.org, Andi Kleen Subject: [PATCH 9/9] test patch: Add fake branch cycles to input data in report/top Date: Sat, 18 Jul 2015 08:24:54 -0700 Message-Id: <1437233094-12844-10-git-send-email-andi@firstfloor.org> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1437233094-12844-1-git-send-email-andi@firstfloor.org> References: <1437233094-12844-1-git-send-email-andi@firstfloor.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andi Kleen Not to be merged, but useful for testing if you don't have hardware with cycles branch stack support. --- tools/perf/util/hist.c | 2 +- tools/perf/util/machine.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index a6e9ddd..8a4bf84 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -1421,7 +1421,7 @@ void hist__account_cycles(struct branch_stack *bs, struct addr_location *al, struct branch_info *bi; /* If we have branch cycles always annotate them. */ - if (bs && bs->nr && bs->entries[0].flags.cycles) { + if (bs && bs->nr /* && bs->entries[0].flags.cycles */) { int i; bi = sample__resolve_bstack(sample, al); diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 7ff6827..1351f19 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -1597,6 +1597,8 @@ struct branch_info *sample__resolve_bstack(struct perf_sample *sample, ip__resolve_ams(al->thread, &bi[i].to, bs->entries[i].to); ip__resolve_ams(al->thread, &bi[i].from, bs->entries[i].from); bi[i].flags = bs->entries[i].flags; + if (bi[i].flags.cycles == 0) + bi[i].flags.cycles = 123; } return bi; } -- 2.4.3