From patchwork Fri May 24 17:34:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 165144 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp3885032ili; Fri, 24 May 2019 10:35:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqx2tAGZEXF2wUFzNTSHW+azu0+MnIH1hUuxoDzQn4EMNy5VF27WEYNIg+ltPcJYHci+Dg/6 X-Received: by 2002:a65:5647:: with SMTP id m7mr106051436pgs.348.1558719312062; Fri, 24 May 2019 10:35:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558719312; cv=none; d=google.com; s=arc-20160816; b=pMuMJG0igbTiP7LA2tT4BFzzW2ot80SjtiPqpJ10Qt6GGb0Tyzys8NsKiXI2BbRCRg RnmflAyCan6JL+l1xsKt8QRXcbFlG89+hCdwMA5zzi15Hmd8SnBJRZscLo2I0DuXis4Y 0d8U9O4wQj6zBG4X4VX2HyDEpC5lUmVWwrZ8U2fjvYU/jRsNTD8AN2gCsSABy6I3oDJv KjW9UGbHvhy7gzCTWTaRAETGSx0GPhoOTgQs5R9OcGqd3pYE6Zsh6XF77++LVmTcBBXQ RyjracPwS8ZGQVeRew6eY0I8wExj/iR403vstzvHvIZGyNGLcWnrVg8fAVpU7tmAJBVm HGHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=2HZ3k/jKy00KtbnPh50IWBP9tRSwh/NwMqnQ0RiJHoo=; b=HRcXpfIEV0P72NQ/J5Oltq7Z5OAN2ahiUTjXkEAFKIGyKzruxX12S/CIf+nXI31S0m a6KkwlOI3x1cktBiIe8KK0S8TSPAVF1ZbRbWchBPvptXizQntHXQmrrYhK3KLIjkVflr tg2QzUF4VJeo7DdD4GhtTGPwgRaYBXjeqK3isd/twIOydm/B3OGu908+vCzoKmNU48nD uymmSITXWftQXT/0rU+203OuQp8Dp1vxGbK7OgfeRkIGsSzjkmXqpcM8JV5ZEDZ7LDAY Q02R15u99veSJaNpwubkqGz3sglDqjJqQyptYjFsCSPZSMrbyqCZQ0LbAXj2tPP+O2Ic M3Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XHmdTsjR; 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 j8si4707974pll.17.2019.05.24.10.35.11; Fri, 24 May 2019 10:35:12 -0700 (PDT) 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=XHmdTsjR; 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 S2391295AbfEXRfL (ORCPT + 30 others); Fri, 24 May 2019 13:35:11 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:43775 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391077AbfEXRfK (ORCPT ); Fri, 24 May 2019 13:35:10 -0400 Received: by mail-pg1-f193.google.com with SMTP id f25so5410123pgv.10 for ; Fri, 24 May 2019 10:35:10 -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; bh=2HZ3k/jKy00KtbnPh50IWBP9tRSwh/NwMqnQ0RiJHoo=; b=XHmdTsjRZxyWcl0BiESRKUpcITtgnfIFNSwhltWBUaPNXOip2l2vafL53RMN4o1OWT 8XihDlq4nPB/anHG9dwBFN3wi3oJkG4a2ozumVpgWfzg2kH5nq1rQ6jN1+Ni6hRaZY81 Y8MeIMQZqqZtY4EcXgZNbHgHf9El7bHoyUVHtxLadzognn/Yhq6a6MEbcn0mZUp+Mtge FL9KNFQBjEaGPWRMxIUi9CDJVLM1S8MZcJMjnPCVb1y/wfjzWano9pBzCAbUOpWn8Dah Ra+IdFuHgC4urm3MUsgbyVA8bAIMQgDXs1UzFvTjsvdw/35zMTrQ5ssImr6HmdfpEC3i h16w== 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; bh=2HZ3k/jKy00KtbnPh50IWBP9tRSwh/NwMqnQ0RiJHoo=; b=JUausZr69+n4r0PBCkIWLdVWN84hY9dqSBUaOAb2c5GppbtUnfKT+jPwsGCIERMZAR LYlG29KqF6og+fK1B4SzFpEXd+G+TtqirPsTyQWdx4iv8I/euU2mZnTQ+Eiutb7p/vuR Fx+EwbMxdW4HNYaQ7BY4QS+pzhz3/fdh97UleP0WtE/B5wK22x1f9XkyrACxog3N5YZa ElbdC02KEqBl+miQnVZYGAcxt9vxgbM5Lmj7u/rDS+Y+uHpVWRit8O6lVgckSj3Lvr8u ejIh01wQH3p+Vewtha/xe/FWEUuz3+/DEzCrPdgxiwmiAgzAymPiLU+ssRbXPlp11/Cu E4Dg== X-Gm-Message-State: APjAAAW2MGTfd1Zr3J9AZCHz7V06bEwcpHE2A8FylGbCYTxyDb0V0C8j 4EWHkpHy16cy413xcVO97BBRhw== X-Received: by 2002:a17:90a:36d0:: with SMTP id t74mr10774523pjb.4.1558719309972; Fri, 24 May 2019 10:35:09 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id k13sm2809575pgr.90.2019.05.24.10.35.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 May 2019 10:35:09 -0700 (PDT) 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, suzuki.poulose@arm.com, leo.yan@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org Subject: [PATCH v2 00/17] perf tools: Coresight: Add CPU-wide trace support Date: Fri, 24 May 2019 11:34:51 -0600 Message-Id: <20190524173508.29044-1-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset adds support for CoreSight CPU-wide trace scenarios. More specifically it extends the work that was done for per thread scenarios to handle more than a single trace ID. It also temporally correlate traces based on timestamp generated by the tracers so that rendering by the perf mechanic is ordered. Everything is based on Arnaldo's perf/core branch (46d4c9a05285). I will send another revision when it is rebased to a 5.2 rc candidate. Before this set: # root@juno:/home/linaro# perf record -e cs_etm/@20070000.etr/ -C 2,3 sleep 1 failed to mmap with 12 (Cannot allocate memory) After this set: # root@juno:/home/linaro# perf record -e cs_etm/@20070000.etr/ -C 2,3 sleep 1 [ perf record: Captured and wrote 1.352 MB perf.data ] Regards, Mathieu Changes for V2: * Fixed error condition in function cs_etm_set_option() (Leo) * Fixed changelog spelling error (Leo). * Moved from calloc() to malloc() in cs_etm__etmq_get_traceid_queue() * Got rid of CS_ETM_PACKET_QUEUE_NR macro * Fixed indentation problem in function cs_etm__process_traceid_queue() (Leo). Mathieu Poirier (17): perf tools: Configure contextID tracing in CPU-wide mode perf tools: Configure timestsamp generation in CPU-wide mode perf tools: Configure SWITCH_EVENTS in CPU-wide mode perf tools: Add handling of itrace start events perf tools: Add handling of switch-CPU-wide events perf tools: Refactor error path in cs_etm_decoder__new() perf tools: Move packet queue out of decoder structure perf tools: Fix indentation in function cs_etm__process_decoder_queue() perf tools: Introduce the concept of trace ID queues perf tools: Get rid of unused cpu in struct cs_etm_queue perf tools: Move thread to traceid_queue perf tools: Move tid/pid to traceid_queue perf tools: Use traceID aware memory callback API perf tools: Add support for multiple traceID queues perf tools: Linking PE contextID with perf thread mechanic perf tools: Add notion of time to decoding code perf tools: Add support for CPU-wide trace scenarios tools/perf/Makefile.config | 3 + tools/perf/arch/arm/util/cs-etm.c | 186 ++- .../perf/util/cs-etm-decoder/cs-etm-decoder.c | 269 +++-- .../perf/util/cs-etm-decoder/cs-etm-decoder.h | 39 +- tools/perf/util/cs-etm.c | 1026 +++++++++++++---- tools/perf/util/cs-etm.h | 103 ++ 6 files changed, 1252 insertions(+), 374 deletions(-) -- 2.17.1 Tested-by: Leo Yan