From: Suzuki K Poulose <Suzuki.Poulose@arm.com> To: Robin Murphy <robin.murphy@arm.com>, linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, mark.rutland@arm.com, will.deacon@arm.com Subject: Re: [PATCH 6/6] arm64: perf: Add support for chaining counters Date: Mon, 21 May 2018 11:49:58 +0100 [thread overview] Message-ID: <8fd2f592-c489-8710-92a5-2f4666b1c290@arm.com> (raw) In-Reply-To: <5ff704da-b767-33d7-68c4-7aa02f83ac0a@arm.com> On 18/05/18 15:57, Robin Murphy wrote: > One more thing now that I've actually looked at the Arm ARM... > > On 18/05/18 11:22, Suzuki K Poulose wrote: > [...] >> +static inline void armv8pmu_write_event_type(struct perf_event *event) >> +{ >> + struct hw_perf_event *hwc = &event->hw; >> + int idx = hwc->idx; >> + >> + /* >> + * For chained events, write the high counter event type >> + * followed by the low counter. >> + */ >> + if (armv8pmu_event_is_chained(event)) { >> + u32 chain_evt = ARMV8_PMUV3_PERFCTR_CHAIN; >> + >> + /* Set the filters as that of the main event for chain */ >> + chain_evt |= hwc->config_base & ~ARMV8_PMU_EVTYPE_EVENT; > > The description of the chain event says that the filtering must only be set on the lower counter, and that the chain event itself should be set to count everything. You're right. I intended to fix it, but missed in the rebases. Thanks for pointing out. > >> + armv8pmu_write_evtype(idx, chain_evt); >> + isb(); >> + idx--; >> + } >> + >> + armv8pmu_write_evtype(idx, hwc->config_base); > > It also says that the 'real' event should be set up first and the chain event second, with the rather ominous warning of "If software does not program the event in this way, the count becomes UNPREDICTABLE." > Yep, will fix it. Thanks for the review Suzuki
WARNING: multiple messages have this Message-ID (diff)
From: Suzuki.Poulose@arm.com (Suzuki K Poulose) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 6/6] arm64: perf: Add support for chaining counters Date: Mon, 21 May 2018 11:49:58 +0100 [thread overview] Message-ID: <8fd2f592-c489-8710-92a5-2f4666b1c290@arm.com> (raw) In-Reply-To: <5ff704da-b767-33d7-68c4-7aa02f83ac0a@arm.com> On 18/05/18 15:57, Robin Murphy wrote: > One more thing now that I've actually looked at the Arm ARM... > > On 18/05/18 11:22, Suzuki K Poulose wrote: > [...] >> +static inline void armv8pmu_write_event_type(struct perf_event *event) >> +{ >> +??? struct hw_perf_event *hwc = &event->hw; >> +??? int idx = hwc->idx; >> + >> +??? /* >> +???? * For chained events, write the high counter event type >> +???? * followed by the low counter. >> +???? */ >> +??? if (armv8pmu_event_is_chained(event)) { >> +??????? u32 chain_evt = ARMV8_PMUV3_PERFCTR_CHAIN; >> + >> +??????? /* Set the filters as that of the main event for chain */ >> +??????? chain_evt |= hwc->config_base & ~ARMV8_PMU_EVTYPE_EVENT; > > The description of the chain event says that the filtering must only be set on the lower counter, and that the chain event itself should be set to count everything. You're right. I intended to fix it, but missed in the rebases. Thanks for pointing out. > >> +??????? armv8pmu_write_evtype(idx, chain_evt); >> +??????? isb(); >> +??????? idx--; >> +??? } >> + >> +??? armv8pmu_write_evtype(idx, hwc->config_base); > > It also says that the 'real' event should be set up first and the chain event second, with the rather ominous warning of "If software does not program the event in this way, the count becomes UNPREDICTABLE." > Yep, will fix it. Thanks for the review Suzuki
next prev parent reply other threads:[~2018-05-21 10:50 UTC|newest] Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-05-18 10:22 [PATCH 0/6] arm64: perf: Support for chaining event counters Suzuki K Poulose 2018-05-18 10:22 ` Suzuki K Poulose 2018-05-18 10:22 ` [PATCH 1/6] arm_pmu: Refactor maximum period handling Suzuki K Poulose 2018-05-18 10:22 ` Suzuki K Poulose 2018-05-18 13:10 ` Robin Murphy 2018-05-18 13:10 ` Robin Murphy 2018-05-18 10:22 ` [PATCH 2/6] arm_pmu: Change API to support 64bit counter values Suzuki K Poulose 2018-05-18 10:22 ` Suzuki K Poulose 2018-05-21 23:30 ` kbuild test robot 2018-05-21 23:30 ` kbuild test robot 2018-05-22 9:42 ` Suzuki K Poulose 2018-05-22 9:42 ` Suzuki K Poulose 2018-05-18 10:22 ` [PATCH 3/6] arm_pmu: Add support for long event counters Suzuki K Poulose 2018-05-18 10:22 ` Suzuki K Poulose 2018-05-18 13:22 ` Robin Murphy 2018-05-18 13:22 ` Robin Murphy 2018-05-18 10:22 ` [PATCH 4/6] arm64: perf: Make the cycle counter 64bit by default Suzuki K Poulose 2018-05-18 10:22 ` Suzuki K Poulose 2018-05-18 10:22 ` [PATCH 5/6] arm_pmu: Tidy up clear_event_idx call backs Suzuki K Poulose 2018-05-18 10:22 ` Suzuki K Poulose 2018-05-18 10:22 ` [PATCH 6/6] arm64: perf: Add support for chaining counters Suzuki K Poulose 2018-05-18 10:22 ` Suzuki K Poulose 2018-05-18 13:49 ` Robin Murphy 2018-05-18 13:49 ` Robin Murphy 2018-05-18 15:57 ` Suzuki K Poulose 2018-05-18 15:57 ` Suzuki K Poulose 2018-05-21 13:42 ` Suzuki K Poulose 2018-05-21 13:42 ` Suzuki K Poulose 2018-05-21 14:00 ` Robin Murphy 2018-05-21 14:00 ` Robin Murphy 2018-05-21 14:41 ` Suzuki K Poulose 2018-05-21 14:41 ` Suzuki K Poulose 2018-05-21 15:29 ` Robin Murphy 2018-05-21 15:29 ` Robin Murphy 2018-05-18 14:57 ` Robin Murphy 2018-05-18 14:57 ` Robin Murphy 2018-05-21 10:49 ` Suzuki K Poulose [this message] 2018-05-21 10:49 ` Suzuki K Poulose
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=8fd2f592-c489-8710-92a5-2f4666b1c290@arm.com \ --to=suzuki.poulose@arm.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=mark.rutland@arm.com \ --cc=robin.murphy@arm.com \ --cc=will.deacon@arm.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.