From patchwork Sun Nov 11 05:07:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 996053 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pGj16Jib"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="ZQI7ytwI"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42t23m3qq1z9sBk for ; Sun, 11 Nov 2018 16:08:52 +1100 (AEDT) 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=XFAZi0xhMSdGUVgii3yueq5I+cCzdUre1x+4APqn668=; b=pGj16Jib5nfI9L k8zSdRbuma84/gnf2dqe/68wcS1P9Fr11Q05Q7hM3r+n0CJ0sGq6LKwoxj/EV0Qr/SOO+L+NHlHe6 UUjT2LzJiFxGCDuBaHaHliO/G+EkMnMI/vL/pfk0vjhtv5jUtZC1mp+LWLVFUrd6I917y/Q5sso/z TgY5WJAWugeZe262lEGot7c7OaHBf4+EkHHlCI9dMoPj4849kHuPvHI9rzWYEdSTGjZUrdq3nMvbb isAt0uYdRN5KVgxkLKxHZmooY0dkZb8k1OMBZQ+9DJ9sTaldT2KhvEBug5k+CQNkuMsv/BZWc6Cq3 PBd8GWdw2fQACQgRVfYQ==; 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 1gLhzJ-0006xh-5A; Sun, 11 Nov 2018 05:08:45 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gLhzF-0006wh-PJ for linux-arm-kernel@lists.infradead.org; Sun, 11 Nov 2018 05:08:43 +0000 Received: by mail-wm1-x341.google.com with SMTP id b203-v6so5220579wme.5 for ; Sat, 10 Nov 2018 21:08:31 -0800 (PST) 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=Ow2naLIzo/IFM+0nIo0ADveDbpQEOg73+66OVgTfy9U=; b=ZQI7ytwIjjXjYAjMgqVxg5oX0CEBzSbEVvYwYsQp5QaYUmbf2M94wheVNdyPWeBDVN diFTDtCflyNToZ2xD1XUkVqB7Vp8UPa3FWtsIX5NV9d38pibkxgQBQhlHZxgjOYQFgxn PdtwbZeyW/6HCqLgoC/9TxI8Gt4DtjJvJuYrI= 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=Ow2naLIzo/IFM+0nIo0ADveDbpQEOg73+66OVgTfy9U=; b=THf6CrTgfYPO18gAAZW+vBXxquuePk1+/J9XgBp2qpZuLNh/9JV0T0ZabXU/XXMYeg cEA0+dxOXs8AUHJOtsxDROuQvpDctZ68xhcgl5gdpbOE3E3OajO6j9aP8HRHuB+sH8oG DP967DfsmW1FZ4WrhsI7XU9oE5XJ3eQZNHyw2cn3P4M5TRdU3mo8e5rDikFUFIYMA7bq 00m2Kj13VRkfgPJzDZvDq3InhFftHMBkaNYyp8tBcjUPt4DyiNGAmRTnc9wjX3Gjyee3 0p+LeClMBOlBA63r0yO8XvzQbUH9fCcEMowbmRfvV3OnSXlFssWxAKratsPp4ji8XyDr LnHQ== X-Gm-Message-State: AGRZ1gJTCTImjk29QvUCaXvkHV08LMImAYGKm2LA7ZyWFqrqoeIWVMvs RRUIURg/z6BViK1e8Xeo0dBz0g== X-Google-Smtp-Source: AJdET5c+ldmiS4mLJlazBDn1R2iFi/DEasDshjgvvesFvhzu7CJKJ8P95cqDMrGayeQVlENG1zduRA== X-Received: by 2002:a1c:b645:: with SMTP id g66-v6mr4098881wmf.25.1541912910203; Sat, 10 Nov 2018 21:08:30 -0800 (PST) Received: from localhost.localdomain ([209.250.228.18]) by smtp.gmail.com with ESMTPSA id b66-v6sm4471045wmb.21.2018.11.10.21.08.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 10 Nov 2018 21:08:29 -0800 (PST) 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, Mike Leach , Robert Walker , Al Grant , Coresight ML Subject: [PATCH v2 0/2] perf cs-etm: Add support for sample flags Date: Sun, 11 Nov 2018 13:07:54 +0800 Message-Id: <1541912876-20967-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-20181110_210841_943755_F653A644 X-CRM114-Status: GOOD ( 13.91 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:341 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Yan Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org This patch seris adds support for sample flags so can facilitate perf to print sample flags for branch instruction. The patch 0001 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 0002 is to support sample flags by copying the flags value from packet structure to sample structure, and it includes three fixing up for TRACE_ON/TRACE_OFF 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. This patch series is applied on the acme's perf core branch [1] with the latest commit f1d23afaf677 ("perf bpf: Reduce the hardcoded .max_entries for pid_maps") and has two prerequisites: 1) It's dependent on Rob's patch 'perf: Support for Arm A32/T32 instruction sets in CoreSight trace' [2]; 2) It's dependent on another patch series 'perf cs-etm: Correct packets handling' [3]. After applying the dependency patches and this patch series, we can verify sample flags with below command: # perf script -F,-time,+flags,+ip,+sym,+dso,+addr,+symoff -k vmlinux Changes from v1: * Moved exception packets handling patches into patch series 'perf cs-etm: Correct packets handling'. * Added sample flags fixing up for TRACE_OFF packet. * Created a new function which is used to maintain flags fixing up. [1] https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/log/?h=perf/core [2] http://archive.armlinux.org.uk/lurker/message/20181109.091126.9d69489d.en.html [3] http://archive.armlinux.org.uk/lurker/message/20181111.045938.782b378b.en.html Leo Yan (2): 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 | 168 ++++++++++++++++++++++++ tools/perf/util/cs-etm-decoder/cs-etm-decoder.h | 1 + tools/perf/util/cs-etm.c | 43 +++++- 3 files changed, 210 insertions(+), 2 deletions(-)