Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1614066
| From | Mark Rutland <mark.rutland@arm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v6 07/11] drivers: perf: hisi: Add support for Hisilicon SoC event counters |
| Date | 2017-03-31 16:30 +0200 |
| Message-ID | <tr5IS-5Lu-9@gated-at.bofh.it> (permalink) |
| References | <tjmdQ-87B-9@gated-at.bofh.it> <tnviy-5Yp-25@gated-at.bofh.it> <tqESl-4kQ-5@gated-at.bofh.it> <tqFOr-55A-45@gated-at.bofh.it> <tr5zc-5Hc-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, Mar 31, 2017 at 07:43:20PM +0530, Anurup M wrote: > On Thursday 30 March 2017 04:16 PM, Mark Rutland wrote: > >>>>>+ /* > >>>>>> >>>+ * We must NOT create groups containing mixed PMUs, although > >>>>>> >>>+ * software events are acceptable > >>>>>> >>>+ */ > >>>>>> >>>+ if (event->group_leader->pmu != event->pmu && > >>>>>> >>>+ !is_software_event(event->group_leader)) > >>>>>> >>>+ return -EINVAL; > >>>>>> >>>+ > >>>>>> >>>+ list_for_each_entry(sibling, &event->group_leader->sibling_list, > >>>>>> >>>+ group_entry) > >>>>>> >>>+ if (sibling->pmu != event->pmu && !is_software_event(sibling)) > >>>>>> >>>+ return -EINVAL; > >>>> >Please also check the number of counters. > >>> > >>>Sorry, I could not follow this comment correctly. Could you please explain ? > >>>I check the available counters and update used mask in pmu_add --> > >>>get_event_index > >What I meant was that here we should ensure that a group does not > >contain more events than can fit into counters. > > > >For example, if the HW had two counters, we should reject any group with > >more than two events. Such groups can never be scheduled, and make no > >sense. > > I have referred drivers/bus/arm-cci.c and could find validate_group > and validate_event functions, > which create a fake_pmu to check the available counters for the > events in the group. > Is that the same way which is expected here? Please comment. Something like that. I think it's simplest to have a validate_group() function, which counts the number of counters used. See my suggestion in [1]. Thanks, Mark. [1] https://lkml.kernel.org/r/20170331135955.GB6488@leverpostej
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH v6 07/11] drivers: perf: hisi: Add support for Hisilicon SoC event counters Anurup M <anurupvasu@gmail.com> - 2017-03-30 11:50 +0200
Re: [PATCH v6 07/11] drivers: perf: hisi: Add support for Hisilicon SoC event counters Mark Rutland <mark.rutland@arm.com> - 2017-03-30 12:50 +0200
Re: [PATCH v6 07/11] drivers: perf: hisi: Add support for Hisilicon SoC event counters Anurup M <anurupvasu@gmail.com> - 2017-03-31 16:20 +0200
Re: [PATCH v6 07/11] drivers: perf: hisi: Add support for Hisilicon SoC event counters Mark Rutland <mark.rutland@arm.com> - 2017-03-31 16:30 +0200
Re: [PATCH v6 07/11] drivers: perf: hisi: Add support for Hisilicon SoC event counters Anurup M <anurupvasu@gmail.com> - 2017-03-31 17:10 +0200
csiph-web