Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1237827
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Mathieu Poirier <mathieu.poirier@linaro.org> |
| Newsgroups | linux.kernel |
| Subject | Re: [RFC PATCH 19/20] coresight: etm3x: implementing perf's user/kernel mode |
| Date | Fri, 02 Oct 2015 01:20:02 +0200 |
| Message-ID | <qeViO-2oq-9@gated-at.bofh.it> (permalink) |
| References | <qa6HT-7Th-15@gated-at.bofh.it> <qa6HV-7Th-65@gated-at.bofh.it> <qemEq-1ZQ-5@gated-at.bofh.it> |
| X-Original-To | Alexander Shishkin <alexander.shishkin@linux.intel.com> |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=pDh2G/t3QyfM3ams36i6xmQ0lsOw1mSYSVrzbm48gLE=; b=F2/9jgJfkx3EXL5SiXFdP7ne+EPcSG8Lbowdh86KIEXvpyL6kbFvrGJa7jlSggUsp9 hjHzPONUHiSY1MyEvVCNPElrhF0NpHncVtePBY6N2Qt1OeUshUoyyykyf6xdYjq95f9A +edkuMWQ9xh/BD5F12w7hnKHycYMUx28qGC+OMNiAs0xXaVJf2/81waWauwsmqZs++Tm /pI4nNk5PfWwNXk2yRzRrFLDr3bLlweMh+9vvd6ZStO7vauI31tZZjJT61RSbNN38niR RWVeIpUagQ0Iwe+yLcvcfSQHC1AmQWs4wqwaM63bY7Ri4Nui9LkgzHzGhyLdUdy+3nng L3fA== |
| X-Gm-Message-State | ALoCoQmJU18J754ImCepBVoRbxNwFM997GwxDL8V1HeHyITF9hEjxRlRFDKK2NU8mLCSKPyKHrCq |
| MIME-Version | 1.0 |
| X-Received | by 10.60.98.41 with SMTP id ef9mr8080731oeb.39.1443741403372; Thu, 01 Oct 2015 16:16:43 -0700 (PDT) |
| Content-Type | text/plain; charset=UTF-8 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 86 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Greg KH <gregkh@linuxfoundation.org>, a.p.zijlstra@chello.nl, Arnaldo Carvalho de Melo <acme@kernel.org>, Ingo Molnar <mingo@redhat.com>, Jon Corbet <corbet@lwn.net>, Adrian Hunter <adrian.hunter@intel.com>, Chunyan Zhang <zhang.chunyan@linaro.org>, Mike Leach <mike.leach@arm.com>, Tor Jeremiassen <tor@ti.com>, Al Grant <al.grant@arm.com>, Paweł Moll <pawel.moll@arm.com>, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org>, linux-doc@vger.kernel.org, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org> |
| X-Original-Date | Thu, 1 Oct 2015 17:16:43 -0600 |
| X-Original-Message-ID | <CANLsYkwe2d3_6m6_0dwOkJfm-7knwp7WJJA7c4Qd9LBKpadB3g@mail.gmail.com> |
| X-Original-References | <1442593594-10665-1-git-send-email-mathieu.poirier@linaro.org> <1442593594-10665-20-git-send-email-mathieu.poirier@linaro.org> <87mvw4jjps.fsf@ashishki-desk.ger.corp.intel.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1237827 |
Show key headers only | View raw
On 30 September 2015 at 04:16, Alexander Shishkin
<alexander.shishkin@linux.intel.com> wrote:
> Mathieu Poirier <mathieu.poirier@linaro.org> writes:
>
>> Configure tracers in accordance with the specification conveyed
>> by the perf cmd line tool. For example if only user space is
>> requested, configure the address range comparator with the kerne's
>> address range and set the 'exclude' bit, which will result in
>> tracing everything except the kernel.
>>
>> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
>> ---
>> drivers/hwtracing/coresight/coresight-etm3x.c | 36 +++++++++++++++++++++++++++
>> 1 file changed, 36 insertions(+)
>>
>> diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c
>> index 077b49714259..2f818dbde099 100644
>> --- a/drivers/hwtracing/coresight/coresight-etm3x.c
>> +++ b/drivers/hwtracing/coresight/coresight-etm3x.c
>> @@ -320,6 +320,41 @@ static int etm_parse_event_config(struct etm_drvdata *drvdata,
>> {
>> u64 config = event->attr.config;
>>
>> + if (event->attr.exclude_kernel || event->attr.exclude_user) {
>> + u32 event_encoding;
>> + u32 flags = (1 << 0 | /* instruction execute*/
>> + 3 << 3 | /* ARM instruction */
>> + 0 << 5 | /* No data value comparison */
>> + 0 << 7 | /* No exact mach */
>> + 0 << 8 | /* Ignore context ID */
>> + 0 << 10); /* Security ignored */
>> +
>> + /* Bit 0 is address range comparator 1 */
>> + drvdata->enable_ctrl1 = ETMTECR1_ADDR_COMP_1;
>> +
>> + /* Bit 24 controls whether the address range should be
>> + * included or excluded.
>> + */
>> + if (event->attr.exclude_kernel)
>> + drvdata->enable_ctrl1 |= BIT(24);
>
> Isn't there a privilege level based filtering (OS/USR) in ETM? Shouldn't
> ETMACTRn[10:12] have a setting for that?
Indeed - I'm working with people at ARM on a better solution.
>
>> +
>> + /* No need to worry about single address comparators */
>> + drvdata->enable_ctrl2 = 0x0;
>> +
>> + drvdata->addr_val[0] = (u32) _stext;
>> + drvdata->addr_val[1] = (u32) _etext;
>
> This doesn't cover kernel modules, afaict.
>
>> + drvdata->addr_acctype[0] = flags;
>> + drvdata->addr_acctype[1] = flags;
>> + drvdata->addr_type[0] = ETM_ADDR_TYPE_RANGE;
>> + drvdata->addr_type[1] = ETM_ADDR_TYPE_RANGE;
>> +
>> + event_encoding = 0x00 << 14 | /* Boolean function select A */
>> + 0x01 << 4 | /* Addr range comparator 0-7 */
>> + 0x00 << 0; /* Addr range comparator 1 */
>> +
>> + drvdata->enable_event = event_encoding;
>> + }
>> +
>> /*
>> * At this time only cycle accurate and timestamp options are
>> * available. As such clear everything else that may have been
>> @@ -362,6 +397,7 @@ static void etm_configure_cpu(void *info)
>> etm_writel(drvdata, drvdata->startstop_ctrl, ETMTSSCR);
>> etm_writel(drvdata, drvdata->enable_event, ETMTEEVR);
>> etm_writel(drvdata, drvdata->enable_ctrl1, ETMTECR1);
>> + etm_writel(drvdata, drvdata->enable_ctrl2, ETMTECR2);
>> etm_writel(drvdata, drvdata->fifofull_level, ETMFFLR);
>> for (i = 0; i < drvdata->nr_addr_cmp; i++) {
>> etm_writel(drvdata, drvdata->addr_val[i], ETMACVRn(i));
>> --
>> 1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [RFC PATCH 19/20] coresight: etm3x: implementing perf's user/kernel mode Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2015-09-30 12:20 +0200 Re: [RFC PATCH 19/20] coresight: etm3x: implementing perf's user/kernel mode Mathieu Poirier <mathieu.poirier@linaro.org> - 2015-10-02 01:20 +0200
csiph-web