From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CDE5C433EF for ; Mon, 7 Mar 2022 17:19:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234943AbiCGRUi (ORCPT ); Mon, 7 Mar 2022 12:20:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244442AbiCGRUa (ORCPT ); Mon, 7 Mar 2022 12:20:30 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2C90390FC8; Mon, 7 Mar 2022 09:19:34 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C11F31576; Mon, 7 Mar 2022 09:19:33 -0800 (PST) Received: from e121896.arm.com (unknown [10.57.41.31]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 09FCD3FA45; Mon, 7 Mar 2022 09:19:31 -0800 (PST) From: James Clark To: acme@kernel.org, linux-perf-users@vger.kernel.org, anshuman.khandual@arm.com Cc: german.gomez@arm.com, leo.yan@linaro.com, James Clark , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-kernel@vger.kernel.org Subject: [PATCH 4/4] perf script: Output branch sample type Date: Mon, 7 Mar 2022 17:19:17 +0000 Message-Id: <20220307171917.2555829-5-james.clark@arm.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20220307171917.2555829-1-james.clark@arm.com> References: <20220307171917.2555829-1-james.clark@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The type info is saved when using '-j save_type'. Output this in perf script so it can be accessed by other tools or for debugging. It's appended to the end of the list of fields so any existing tools that split on / and access fields via an index are not affected. Also output '-' instead of 'N/A' when the branch type isn't saved because / is used as a field separator. Entries before this change look like this: 0xaaaadb350838/0xaaaadb3507a4/P/-/-/0 And afterwards like this: 0xaaaadb350838/0xaaaadb3507a4/P/-/-/0/CALL or this if no type info is saved: 0x7fb57586df6b/0x7fb5758731f0/P/-/-/143/- Signed-off-by: James Clark --- tools/perf/builtin-script.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index fac2e9470926..5e4a262a6825 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -859,11 +859,12 @@ mispred_str(struct branch_entry *br) static int print_bstack_flags(FILE *fp, struct branch_entry *br) { - return fprintf(fp, "/%c/%c/%c/%d ", + return fprintf(fp, "/%c/%c/%c/%d/%s ", mispred_str(br), br->flags.in_tx ? 'X' : '-', br->flags.abort ? 'A' : '-', - br->flags.cycles); + br->flags.cycles, + br->flags.type ? branch_type_name(br->flags.type) : "-"); } static int perf_sample__fprintf_brstack(struct perf_sample *sample, -- 2.28.0