From patchwork Fri Nov 16 18:42:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 151371 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp772305ljp; Fri, 16 Nov 2018 10:42:41 -0800 (PST) X-Google-Smtp-Source: AJdET5eojX/0Ti4XQnRYhJXrJ6SJQY49GLLdN8vECsKnwx3xc1ysDrZoZPV1PrcS80mbbVkWunVx X-Received: by 2002:a17:902:a516:: with SMTP id s22-v6mr11958118plq.255.1542393761472; Fri, 16 Nov 2018 10:42:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542393761; cv=none; d=google.com; s=arc-20160816; b=uuXfnJuhV6npBc16FC+cH/3PTUY2/lZlm4BSnzgsowi7n0SoG8GKNRecL0LUkVw32f K9aDpnD9zIC0Men42x5pFvmqhjSUSC8RfenUWSqxJ7/GOOw5q6q3RN2Af0f3W2N3zhly 3rk2WgjN6916863YQ6DG+GBHeZS+0EcfoMWagdbg3Y6K1dqMDcnt2lHBnw/NmnHq7zpx MFkfwQHg+Ut9bCCMayemZsgpsfdi9vEbRmyKjZe/XInZwIuTNMFL2eXZw5xyGiSYs8DN fTUw/goCpEIYXHtF2lBCpcr4fLb0GxLFYjK92gamkERMfkSVklyQLaQU9QBvWYvZjoaV eFNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=7uXAOOMCbxu3NrD8kWXeIGqCAjNGZU3sGkuc69CifPM=; b=E6TuTJZwlI93SZmRpH5eH4R3sOzMGYh92gy/F58CaYmSmNxMPi+dD9VuDsivNdxDKN stVthRK0caBIloblQOfEsHOrkdp4l1xYkiP6eo4s2JGFnEqGzLW/y0wlI4qPo+RUjLcO WIfBlEXE713GygWUyTnTyvkxZbVYY5+Q5JjJaCA+1/jYnpN9WxVy5VSzUCxKZoSWzmTf BBBkdt/zvQjH3xVCd02vNaCniJF/XBgnSUUwgHOyQSCyWkvtDYkiojIRPhFFaswRmJ3i +VUeZklhKA9TLHJATfh0RyizLJHuRfdSShXXmFJVilUepVPzD765TPaitHcdpSsyoN6C 2WtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YgLk3yUg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u5si29432672pgi.146.2018.11.16.10.42.41; Fri, 16 Nov 2018 10:42:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YgLk3yUg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390396AbeKQE4K (ORCPT + 32 others); Fri, 16 Nov 2018 23:56:10 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:46904 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390356AbeKQE4J (ORCPT ); Fri, 16 Nov 2018 23:56:09 -0500 Received: by mail-pl1-f196.google.com with SMTP id t13so8576071ply.13 for ; Fri, 16 Nov 2018 10:42:38 -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:in-reply-to:references; bh=7uXAOOMCbxu3NrD8kWXeIGqCAjNGZU3sGkuc69CifPM=; b=YgLk3yUgQapgyUBaJn6OXlkCfuSls4akSxz02J4HU6Hgb7CKcIouaowVcWNJyKPgZk HGtLGVHkEGO2wp2OA3hG3K8qJSKavM2vgmItJQB8xfHYWbkKaCVE0h28mmIOXgDOYWMY AeARp0N0KuQvWwNJTsPTjzHPHUMiN6ElBlEpo= 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:in-reply-to :references; bh=7uXAOOMCbxu3NrD8kWXeIGqCAjNGZU3sGkuc69CifPM=; b=CUnV5Qiq0dOD5xCkWHEpkDzsxcpjg0oP2b6S+KKUG7uxFRCz9LkCzMEKuO+73JPSx/ 499jS8H2/wPvPiqPisGxq/p4O52vMkrZCwb3sYneHTCMEx4zg6fkoxzMc2QSezZVKpBB m/yeoy7xy2nxa2RcZY1aNP1zdrEq5vabJvhBJ5xilbyhgYOedClQiPNqCbNOizYsYsTQ K6sU3QapQT6BDjGdchjD/h7KhAMX2ZxKpXF2yBFIuYrl34ymeWgF/k3RhvG+VGTAdI9x EtyycVQvoCTmOqv9+XIK3Rkok9KbiBc7JGs5BRmAVr00Cis5bJ20ElHvVzb79w70jsJ8 hIcw== X-Gm-Message-State: AGRZ1gIPmfUpwqlbuoyeD5azi/sKhxDIxthL1ulNZJwpLvuM+raNwJEg UAlwCcoiHQdeXhbEgMB+1DUXeg== X-Received: by 2002:a17:902:14e:: with SMTP id 72-v6mr11612297plb.299.1542393757593; Fri, 16 Nov 2018 10:42:37 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id v20-v6sm33724598pfm.114.2018.11.16.10.42.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Nov 2018 10:42:36 -0800 (PST) From: Mathieu Poirier To: acme@kernel.org Cc: peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] perf tools: Add support for ETMv3 trace decoding Date: Fri, 16 Nov 2018 11:42:31 -0700 Message-Id: <1542393752-10196-3-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542393752-10196-1-git-send-email-mathieu.poirier@linaro.org> References: <1542393752-10196-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for the creation of packet printer and decoder for the ETMv3 trace architecture. That way traces generated by tracers adhering to that trace protocol can be handled properly by the perf infrastructure. Signed-off-by: Mathieu Poirier --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) -- 2.7.4 diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c index 938def6d0bb9..84a86d2f25c9 100644 --- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c +++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c @@ -116,6 +116,19 @@ int cs_etm_decoder__get_packet(struct cs_etm_decoder *decoder, return 1; } +static int cs_etm_decoder__gen_etmv3_config(struct cs_etm_trace_params *params, + ocsd_etmv3_cfg *config) +{ + config->reg_idr = params->etmv3.reg_idr; + config->reg_ctrl = params->etmv3.reg_ctrl; + config->reg_ccer = params->etmv3.reg_ccer; + config->reg_trc_id = params->etmv3.reg_trc_id; + config->arch_ver = ARCH_V7; + config->core_prof = profile_CortexA; + + return 0; +} + static void cs_etm_decoder__gen_etmv4_config(struct cs_etm_trace_params *params, ocsd_etmv4_cfg *config) { @@ -237,10 +250,16 @@ cs_etm_decoder__create_etm_packet_printer(struct cs_etm_trace_params *t_params, struct cs_etm_decoder *decoder) { const char *decoder_name; + ocsd_etmv3_cfg config_etmv3; ocsd_etmv4_cfg trace_config_etmv4; void *trace_config; switch (t_params->protocol) { + case CS_ETM_PROTO_ETMV3: + cs_etm_decoder__gen_etmv3_config(t_params, &config_etmv3); + decoder_name = OCSD_BUILTIN_DCD_ETMV3; + trace_config = &config_etmv3; + break; case CS_ETM_PROTO_ETMV4i: cs_etm_decoder__gen_etmv4_config(t_params, &trace_config_etmv4); decoder_name = OCSD_BUILTIN_DCD_ETMV4I; @@ -398,11 +417,17 @@ static int cs_etm_decoder__create_etm_packet_decoder( struct cs_etm_decoder *decoder) { const char *decoder_name; + ocsd_etmv3_cfg config_etmv3; ocsd_etmv4_cfg trace_config_etmv4; void *trace_config; u8 csid; switch (t_params->protocol) { + case CS_ETM_PROTO_ETMV3: + cs_etm_decoder__gen_etmv3_config(t_params, &config_etmv3); + decoder_name = OCSD_BUILTIN_DCD_ETMV3; + trace_config = &config_etmv3; + break; case CS_ETM_PROTO_ETMV4i: cs_etm_decoder__gen_etmv4_config(t_params, &trace_config_etmv4); decoder_name = OCSD_BUILTIN_DCD_ETMV4I;