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: 9235195 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8D292602F0 for ; Mon, 18 Jul 2016 19:56:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F9981FF27 for ; Mon, 18 Jul 2016 19:56:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 74582205AD; Mon, 18 Jul 2016 19:56:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ED8A31FF27 for ; Mon, 18 Jul 2016 19:56:23 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bPEcx-0000dQ-Q9; Mon, 18 Jul 2016 19:54:55 +0000 Received: from mail-io0-x233.google.com ([2607:f8b0:4001:c06::233]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bPEaD-00077S-RF for linux-arm-kernel@lists.infradead.org; Mon, 18 Jul 2016 19:52:07 +0000 Received: by mail-io0-x233.google.com with SMTP id 38so463944iol.0 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=FahNVavqGl5Eu0/YX0rGAitzTWTdl+2EA53rMLnyvMEP+vVoOzzGDfAiCMuuX9r9a5 fl4OT9fjzeEg4q1bxZhFa42GCYq6PSX2UDPIpyvi9/63HQ8o/hcd/M7acer8RaCJCi09 ADzaQp2J/o8UoJteyD4h6E6xDf+MUWmMGQpdwYDzBMk5AvoMVInXm9rKkVsk86M/UDUg jAdvIb1GkvgfF00tEcbL7zvJ/pMy4louXDbd5pXwNqWPy+aDk6/gvPgj1suo55ARa9c6 dHl7Gcg0muLOaVJ7iqag7hXT9wIU5KZEJIUs+G4ksGwcDfazzPlNYFUU6bbeV+Of1q+G pQgA== X-Gm-Message-State: ALyK8tLioCkmZajWf+bYTIYAwU7bw2eRIGLuXHoLPXs6yhozkwCYrfQ9AMFNs3PybkiZjrBO 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160718_125206_089729_C95D11AD X-CRM114-Status: GOOD ( 11.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org, Mathieu Poirier , linux-doc@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) 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 -------------------------