From patchwork Thu Dec 6 21:25:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 153065 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp11046558ljp; Thu, 6 Dec 2018 13:30:24 -0800 (PST) X-Google-Smtp-Source: AFSGD/UiWDlBG2XEwuXRrS9sQC9mXv3YRhnaQtwaPlpy0VXUielrEeZG8DFCNTbkAuUm+rsJJ471 X-Received: by 2002:a63:a84a:: with SMTP id i10mr25918460pgp.263.1544131824176; Thu, 06 Dec 2018 13:30:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544131824; cv=none; d=google.com; s=arc-20160816; b=yvF92NULPBXmfS8wrTNa55WL1c6PixjuKkUHmJ1URWjD2zi/FLRdiHFoN+vbkd0hGo ef8g3PQIPlkB4qVlk6kByyVnk46Fk3aeg76QA6NchP/puC6XjRrXkjlCdba3A3/1YyAT 7wBwEhc3c151S1gx6+sJTs2kQ1NVkt8j1aOHQUdyR8ywVHMrbMmvHRntiIZlWxmrvrMo b5DqxuSVRaUb0WFvSzQh9K/OPKgrn1+WZJnZIqH5vYmsCQnw2nl3UyhlTZ8AyCa3cDt+ kAN+fivpQr35agzLJmZp+VwE+l7c+1DRPUsHmZQCYwR/+NKSpzWltdsgDiSBbNkiHlaL wjVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rzdEyahUnp1vw8KttHml6c5zxLeLoKgIioNfhfFl09k=; b=O68ujJ2pSxtjImzwnKmCkiJXF+Oha6sZ5VMO4J72QfqPPdY4QSzyu+abM5/JNJUn8+ IHYYmbCARzd5LFzSipZaeTZGn33db611GUTqglLirurnK1PLUI0kdOnIhERxNO/p9deC tfA7x5TKf46YnhkW3PYh4BFENtE8YzuAnJra0AwKc3sc19e2qLZdWDQvbbukWZ275QC3 XnC8rkQ4ypKtANZ6N+8NpuOjXMUCnTJBZ9tlhoGGlVUbkKYWYS2peqDdQm9IDaJ6fVuG tNyjFb6We2Au5BqNMkh81/aYexv8I9ZXyuqPDLU5Z9KEXMGT5IJunfWd0BdtluwtVtRr itWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Q6Hg8r6V; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s35si1092177pgk.392.2018.12.06.13.30.23; Thu, 06 Dec 2018 13:30:24 -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=@kernel.org header.s=default header.b=Q6Hg8r6V; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726723AbeLFVaW (ORCPT + 31 others); Thu, 6 Dec 2018 16:30:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:48712 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726461AbeLFVaU (ORCPT ); Thu, 6 Dec 2018 16:30:20 -0500 Received: from quaco.ghostprotocols.net (179.187.13.223.dynamic.adsl.gvt.net.br [179.187.13.223]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7BC342082B; Thu, 6 Dec 2018 21:30:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544131819; bh=AIgtURRIhEtOHGMPeP9Ir9TKedr2M3hpVEkium/Fg/c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q6Hg8r6VTSfoLnBybixm90UGNO4cVzUJ7BVfM4ph3qucuwDpmQzuHDr7ARfgdF0wc mNpslVs/nHanGa3vC5s1qUm4Hcs4ua+RZo9eXE8OjN4J9yqZMRC4/xSdVX3nFmL9E3 9RcmUqN2Y4SnfEUTKpXWyJ6cNRN8tA/+xENFlLmg= From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Mathieu Poirier , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Peter Zijlstra , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, Arnaldo Carvalho de Melo Subject: [PATCH 58/75] perf cs-etm: Add support for ETMv3 trace decoding Date: Thu, 6 Dec 2018 18:25:45 -0300 Message-Id: <20181206212602.20474-59-acme@kernel.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181206212602.20474-1-acme@kernel.org> References: <20181206212602.20474-1-acme@kernel.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mathieu Poirier 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 Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1543955944-10042-3-git-send-email-mathieu.poirier@linaro.org Signed-off-by: Arnaldo Carvalho de Melo --- .../perf/util/cs-etm-decoder/cs-etm-decoder.c | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) -- 2.19.2 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 5efb616bd609..952d1f43f3fa 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; @@ -427,11 +446,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;