From patchwork Mon Jul 18 19:51:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 72252 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp291271qga; Mon, 18 Jul 2016 12:53:14 -0700 (PDT) X-Received: by 10.66.155.129 with SMTP id vw1mr58110032pab.148.1468871594264; Mon, 18 Jul 2016 12:53:14 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bg10si16080575pab.12.2016.07.18.12.53.14; Mon, 18 Jul 2016 12:53:14 -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; 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 dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752553AbcGRTwz (ORCPT + 29 others); Mon, 18 Jul 2016 15:52:55 -0400 Received: from mail-io0-f180.google.com ([209.85.223.180]:35121 "EHLO mail-io0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752341AbcGRTvp (ORCPT ); Mon, 18 Jul 2016 15:51:45 -0400 Received: by mail-io0-f180.google.com with SMTP id m101so366568ioi.2 for ; Mon, 18 Jul 2016 12:51:45 -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:in-reply-to:references; bh=GeCj0qv9EOwk82shTNs+IUcuanIxZC/fka4jrstC3xs=; b=RZ7e6Xo0j0oHWY/G3NumcTMERJg4eVBVRKZEamPkNL9IkOTEKnn6G+k/0c0bmsvtGY DoPvOXxav2T1S7Bws42ohtsiv3WOALwCSiMCbieuRF96WBbsmN6nOc36fTqQcKi34bwH 8drToEnGaMH8cGEMsqCzNu1ijZObiqp+yVlE4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GeCj0qv9EOwk82shTNs+IUcuanIxZC/fka4jrstC3xs=; b=NDbaXsAqGfX1zQiuPJPRQj4kj7sBRwn0d4lKuE5+EnwjQHt725e1JEKR92LVT4qCKr 52sP21l9iCeasI5h11uLNc5124UAhUr3DUQeSSVdStFAUYQOmfY4yUA+G1q9r5RQxQJq 0ZiPvLgVjIxMd2TqKWf8M3WWWEsYDZ+QG9mJcDkpbyrnVj56c8Vg9aLJWJqVYCxqV3ya kAGt0hvxRtDoH4AyWoSqxZBjM/xvmbBReHs5k92whMcxTC0cMcuXSuakc+KCQSqBeaOE dESBvSlgOkPtOjDQrYXss8G+TT+zXsLciyFtcZ6wgpouyInaKNfn8+hkF+IP6pbISzdi hKaw== X-Gm-Message-State: ALyK8tJq+d674begmpPlqH5ooJiGA0QjZJzEt+urPSXJcj16MEs8vx/q1K5RccuNNqMPsGmK X-Received: by 10.107.43.16 with SMTP id r16mr4590970ior.81.1468871504961; Mon, 18 Jul 2016 12:51:44 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id r128sm5270676ita.6.2016.07.18.12.51.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Jul 2016 12:51:44 -0700 (PDT) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, alexander.shishkin@linux.intel.com, Mathieu Poirier , linux-doc@vger.kernel.org Subject: [PATCH 10/10] coresight: documenting range and start/stop filtering Date: Mon, 18 Jul 2016 13:51:31 -0600 Message-Id: <1468871491-10997-11-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1468871491-10997-1-git-send-email-mathieu.poirier@linaro.org> References: <1468871491-10997-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 To reduce the amount of traces generated by tracers range and start/stop address filtering has been implemented. This patch provides example on how to use the various options currently supported. Signed-off-by: Mathieu Poirier Cc: linux-doc@vger.kernel.org --- Documentation/trace/coresight.txt | 48 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) -- 2.7.4 diff --git a/Documentation/trace/coresight.txt b/Documentation/trace/coresight.txt index a2e7ccb62c2b..a19d7e60937a 100644 --- a/Documentation/trace/coresight.txt +++ b/Documentation/trace/coresight.txt @@ -408,6 +408,54 @@ Instruction 13570831 0x8026B584 E28DD00C false ADD Instruction 0 0x8026B588 E8BD8000 true LDM sp!,{pc} Timestamp Timestamp: 17107041535 +Address filtering +----------------- + +CoreSight tracers produce an astonishing amount of traces, more often than not +much more than trace buffers can handle, and definilty far beyond the +processing capabilities of humans. To trim down the amount of trace generated +address filters can be specified from the perf command line. + +Currently supported filters include range and start/stop address. When a +range is specified traces will be collected when the instruction pointer falls +within the specified addresses. For start and stop filters, traces collection +start when the instuction pointer matches the start address, and stop when +the stop address has been reached. + +Filters can be specified from the perf command line as follow: + +- To start trace collection when the IP equal a specific function in a binary + executable or library: + + perf record -e cs_etm// --filter 'start 0x72c@/opt/lib/libcstest.so.1.0' --per-thread ./main + +- To stop trace collection when the IP equal a specific function in a binary + executable of library: + + perf record -e cs_etm// --filter 'stop 0x790@/opt/lib/libcstest.so.1.0' --per-thread ./main + +- To start and stop tracing at various stages of kernel execution: + + perf record -e cs_etm// --filter 'start 0xffffff800856bc50,stop 0xffffff800856bcb0,start 0xffffff8008562d0c,stop 0xffffff8008562d30' --per-thread uname + +The only requirement on the number of start/stop filters is that they don't go +beyond the amount of comparator implemented on the system. Range filters are +specified using a slightly different syntax: + +- To collect traces in a specific range in a binary executable or a library: + + perf record -e cs_etm// --filter 'filter 0x72c/0x40@/opt/lib/libcstest.so.1.0' --per-thread ./main + +- To collect traces in a specific range in kernel space: + + perf record -e cs_etm// --filter 'filter 0xffffff8008562d0c/0x48' --per-thread uname + +This time the number of comparator _pairs_ implemented in the trace engine is +the only restriction on the amount of filters that can be specified. + +It is possible to mix user and kernel space filters, as long as they are the +same type. Mixing range and start/stop filters is currently not supported. + How to use the STM module -------------------------