andikleen / pmu-tools

Intel PMU profiling tools
GNU General Public License v2.0
1.98k stars 331 forks source link

jevents: multi-pmu events create more events than necessary #405

Open matthew-olson-intel opened 2 years ago

matthew-olson-intel commented 2 years ago

Found something else when testing on large groups of perf events today: when jevents is given multi-PMU events, regardless of if they're grouped, the parse_events loop creates two events for each first PMU instance. For example, if I specify one iio event, and there are six uncore_iio_* instances, parse_events will add seven elements to the eventlist, the first of which is here, and the second of which is either here or here, depending on if it's grouped or not.

This is a pretty easy fix. Will submit a PR.

matthew-olson-intel commented 2 years ago

Oh, and forgot to mention that this line is too general: if there are PMUs which are a superset of the desired PMU (e.g. uncore_iio_* alongside uncore_iio_free_running_*), this glob has a possibility of collecting those, too, which might not be a correct PMU to gather that event. Thus, this might cause an Invalid argument error later on.