From patchwork Tue Dec 4 20:39:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 152865 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp8511830ljp; Tue, 4 Dec 2018 12:39:22 -0800 (PST) X-Google-Smtp-Source: AFSGD/WNmJfzIrpjqW4C/qpuqQ+FjDvU2dH11sIlRuVy+HJ73s9eie4WMhm3qoG2XyJS3t1cqRdK X-Received: by 2002:a62:2606:: with SMTP id m6mr20992864pfm.133.1543955961959; Tue, 04 Dec 2018 12:39:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543955961; cv=none; d=google.com; s=arc-20160816; b=sYNZrRFgu4Dwqw5PSYldS/weReFHdOs/tKbWDXk9mKMOL4JP7QgPPF8mOd8jzE6+Qf YJQdye6yBxrYdZdM77FrkKr6rRPGTrVnBGPvBBcmMxTZTHBVQCcZPcF5QAXcv/MH1vJz RVhayDYBHqf1uWchZQmS31l31cCUW5myjQJcN9m3tRgdxvNAAB6KmWxVdYF+sbrM0CiQ JQScPd6uQjMyC018+m/ea3sB/3tzwkfb9hMafGoT5SKiq/yGHtM33ma6N8+QY10DtpH/ 2c1xuK15y8a8oNClNWrzXehGnZcrSbThG12uJdbdtpJmy2HHWeZIBhmvABtroyv2mHWj x0dQ== 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=VqBc9Gq3LytAyrW6i6tZvFTE9zrKBHeOcOUbC3Kc/Ze0zh2e+t9jMWMolgNHk+99hH e57e+nXat1Q8kyR5vS66pcvj00j+yx9u4AOM7dmEswZBA2EbcHiT6rgP+2dQnmvX1oH9 tRG8D4VWYQHZwuByh422yeDydlo1uxeKUXXSH8t+fQiDtHtEJ4qcDB9suSBmOdqbQrVW +910fu9rwVgzpK1mpn8IlWOVZ8SyqN+xSiVcDUuvNdFsJb7Inx/qze80uK9eoxZMCxNz r1qY6u8DJjw4xXcXwRAq7IPup41ZImvL+3pOy/Rzyk0XZJwxgvQ6gWsnajIZqP14vagO 0xUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iecUL2z1; 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 59si19859058ple.291.2018.12.04.12.39.21; Tue, 04 Dec 2018 12:39:21 -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=iecUL2z1; 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 S1726475AbeLDUjU (ORCPT + 31 others); Tue, 4 Dec 2018 15:39:20 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:41304 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726268AbeLDUjJ (ORCPT ); Tue, 4 Dec 2018 15:39:09 -0500 Received: by mail-pf1-f193.google.com with SMTP id b7so8794102pfi.8 for ; Tue, 04 Dec 2018 12:39:09 -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=iecUL2z1/4wS3WhGPKUzl4IQnx1Ey/RZTh0iOlII1lWJjwffvCYN17q47rRfM4lh78 k+d0YcBAYjjPqzYzpSVzj2Wm1VNazAuT4OBU9KN8HAdBn/GgM1vLjSkT8qXZGAUtb6s4 jATqDhJlqMq0vNWEglGTG/DQc7I6+o7Q5piGE= 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=cjaRd7WreXbLyWZ7DZmZMMiBsE0r4OlmOTDhHlCaTYI6sMCBhFm5qEA4LtSTxTlz9T Wp8qq6wRywGL3OIR8L/U3AJJmrqAv4CHkVwIa03qlUN8l9sgppKAEF/jZRemZ3zVVMay XpUEWP//GuiJ7sTpWj5nNNZhgHDujCAiaUEVOL1P5hTBP9H2uKOnL4hS2pO2+3Hdy72R bBG4kwOZkRgRtgle5PphBzRpdYf7NgABuXZIFPMnPjsZWCJm0t+RvCoehAKvIo3OzdOx Fuv5MMnGNrJDrAhbwLA+zgTI/5loLQD/MG+wPrTyHgNoxcHbXWq21J8A2AlU6WDsyI2q oVSA== X-Gm-Message-State: AA+aEWZdAHAiESQ2NhVMjwUr9D9fseF7fWiUmSu6xLb0ybN0jFfjMk/l Lgpeuz2HIiiue+PrBeeZIG65IA== X-Received: by 2002:a63:e302:: with SMTP id f2mr18305424pgh.320.1543955948796; Tue, 04 Dec 2018 12:39:08 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id r76sm29783274pfb.69.2018.12.04.12.39.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Dec 2018 12:39:08 -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 RESEND 2/3] perf tools: Add support for ETMv3 trace decoding Date: Tue, 4 Dec 2018 13:39:03 -0700 Message-Id: <1543955944-10042-3-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1543955944-10042-1-git-send-email-mathieu.poirier@linaro.org> References: <1543955944-10042-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;