From patchwork Sun Oct 28 12:34:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 10658567 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C16A3109C for ; Sun, 28 Oct 2018 12:35:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A94C0287A0 for ; Sun, 28 Oct 2018 12:35:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B7C62997E; Sun, 28 Oct 2018 12:35:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CD935287A0 for ; Sun, 28 Oct 2018 12:35:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=qiduIPRPxppwMj+Bh4SSuNGOQZpUgBroMHFAIc2PxsI=; b=F+nF0hPMuEQ6uU wbQBGWVfGjte5KoyBvC+Y2r+5z1+tMQT4+NAVmjIO4nI2tCiU3nOybhCl+WjygVCoAtSxjbLOGImi gN84C2UnYit0wlAZjEonbzBL8N6vt4LpXnFaKoO9MCNvvLWxlXfdqdK7nHemjsFI4J3hr2sMD6tY0 uNBYC7XZxnEJWGmu/0aFqFgtfOuFCPqjAKRZXMP945P7Wyanopj0bG6JvxWNCeRTrigpJNBHfHB3m 9na2fLmMByNckMCGSv73zm4nMaSzcd7wh6UofbPaI8lWWEQFR/CAzZsMCTK3iYKIp7nvRA4HPvCrt HpwuQRzziDx94+LIBEWw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gGkHz-0002co-2B; Sun, 28 Oct 2018 12:35:31 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gGkHv-0002aj-0p for linux-arm-kernel@lists.infradead.org; Sun, 28 Oct 2018 12:35:28 +0000 Received: by mail-wm1-x343.google.com with SMTP id 143-v6so5493164wmf.1 for ; Sun, 28 Oct 2018 05:35:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=J19T3Goe9Qyq7xQM4/QFwTkUNe2LU8Fn8VCV3sVm5CA=; b=JeOZbKs43ekLZ3Wv76HuUkfoxCnQnupDJDsFn4cPbJ5Z1OJWCelE7rX+d9BY62hP9o XebfKVftjG3dXgr3LHjFfssJvxlc7VVs4q5uhXtfgIkCk4tkOkJCBBQojcQt8yISSoxV TLppkAv5B34Z/2lqXAqGzBn1Rcc5zqS3tB8ms= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=J19T3Goe9Qyq7xQM4/QFwTkUNe2LU8Fn8VCV3sVm5CA=; b=av/tnHvgJrRjQ628GARD0tUCcsHKCmJPmMLpQQt5gXOSl6pzKSypkBuWX00XG93IiR eP4ijOttBSsNfu5Ck22lKfzp/WYG9uvLMmPfHXneMVCNXN3mq4NNGGHohVrLTLpWTGwr 4AsrNMypvXrb4bPZ9L+aoaIyeEsvr2Qiha2aB6IBGoMKtrF/lKTVlCFXCSmwt7XCPMil KwP0xzIgIYMxrLYt8rPb2N2PsMfp7pZiMSi2ap5rhOI0m5g1Shy7M9GWVYQL2spO0eCr Z9FXhSsePzhH9DaLU5/WDyt5qklkAvkqMee2+dn0ZMzrSwuZQ8MJpEMmOTIhamQO6rfh gBzg== X-Gm-Message-State: AGRZ1gJP4xldhpZThma7dG+yIVQdBP01kTYXM+2VNQy/gdJU9RDODRiB 8J85uIF1a3N0U3e9Ovqvj6ywBWE8lrQyEsl1 X-Google-Smtp-Source: AJdET5fIpc4OJ0ZEBXV32qQGjF7UQA53iRJUX8xEAmfXr4W4P805Fz3FZVrKS8gAUhye96VV14SqsA== X-Received: by 2002:a1c:9cc9:: with SMTP id f192-v6mr11313690wme.135.1540730114843; Sun, 28 Oct 2018 05:35:14 -0700 (PDT) Received: from localhost.localdomain ([209.250.228.18]) by smtp.gmail.com with ESMTPSA id v30-v6sm18926830wra.67.2018.10.28.05.35.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 28 Oct 2018 05:35:13 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Mathieu Poirier , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Coresight ML , Mike Leach , Robert Walker , Al Grant Subject: [PATCH v1 0/4] perf cs-etm: Add support for sample flags Date: Sun, 28 Oct 2018 20:34:51 +0800 Message-Id: <1540730095-6732-1-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181028_053527_063257_6F364285 X-CRM114-Status: GOOD ( 12.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Yan Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch seris adds support for sample flags so can facilitate perf to print sample flags for branch instruction. The branch instructions also include exception taken and return related instructions, so the first patch is used to generate branch sample for exception packets; and the second patch is to track the exception number. The patch 0003 is to set branch instruction flags in packet, this patch has the core code in this series to set flags according to the decoding element type, and also based on the elements including instruction type, subtype and condition flag to help making decision to set flags value. The patch 0004 is to support sample flags by copying the flags value from packet structure to sample structure, and it includes two fixing up for TRACE_ON and exception packets. The patch series is based on OpenCSD v0.10.0 and Rob's patch 'perf: Support for Arm A32/T32 instruction sets in CoreSight trace' also is prerequisite to support A32/T32 ISAs. The patches can be applied on the acme core branch [1] and tested on Juno board with below commands for A64 and A32/T32 building: # perf script -F,-time,+flags,+ip,+sym,+addr -k vmlinux Leo Yan (4): perf cs-etm: Generate branch sample for exception packet perf cs-etm: Track exception number perf cs-etm: Set branch instruction flags in packet perf cs-etm: Add support sample flags tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 237 +++++++++++++++++++++++- tools/perf/util/cs-etm-decoder/cs-etm-decoder.h | 11 +- tools/perf/util/cs-etm.c | 44 ++++- 3 files changed, 277 insertions(+), 15 deletions(-)