From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753502AbbE0Rw2 (ORCPT ); Wed, 27 May 2015 13:52:28 -0400 Received: from mga03.intel.com ([134.134.136.65]:30212 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753378AbbE0RwN (ORCPT ); Wed, 27 May 2015 13:52:13 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,506,1427785200"; d="scan'208";a="736254679" From: Andi Kleen To: acme@kernel.org Cc: jolsa@redhat.com, namhyung@kernel.org, eranian@google.com, linux-kernel@vger.kernel.org, Andi Kleen Subject: [PATCH 11/11] test patch: Add fake branch cycles to input data in report/top Date: Wed, 27 May 2015 10:51:54 -0700 Message-Id: <1432749114-904-12-git-send-email-andi@firstfloor.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1432749114-904-1-git-send-email-andi@firstfloor.org> References: <1432749114-904-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 6f1e411..f091f1d 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -1418,7 +1418,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 daa5591..418b6bd 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -1552,6 +1552,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.1.0