On Wed, 19 Dec 2018 at 02:40, Suzuki K Poulose <suzuki.poulose@xxxxxxx> wrote:
On 18/12/2018 17:34, Mathieu Poirier wrote:
Good day Suzuki,
On Tue, 18 Dec 2018 at 07:14, Suzuki K Poulose <suzuki.poulose@xxxxxxx> wrote:
We could assign a static "id/key" exported either via the device sysfs dir or
the "pmu" dir. I prefer the latter.
Not sure what you mean by "pmu" directory - would you mind expanding
on that? Using sysfs would be quite easy but I am reluctant to create
a new id/key mechanism and introduce another entry when we have the
component address that is unique and already available in the amba
directory structure.
We could add another directory under :
/sys/bus/event_source/devices/<PMU>/
\_ events/
\_ format/
say :
\_ drv_config/
Or
\_ sinks/
and list the sinks, eg:
# cd $sysfs_pmu_dir/sinks
# cat <name_of_the_sink>
ID_of_the_sink
There is merit to this idea. Thinking along those lines simply using
"sinks" is probably a better approach since we don't yet know how PMU
configuration will unfold. I'm also wondering if we have to
explicitly list the ID of the sink. The ID itself should be fetch
from the device specific entries in sysfs like the "resource" property
of sinks that show up on the AMBA bus. Sinks that don't show up on
the AMBA bus will likely have a "reg" property of something similar
and that is where the ID should be taken from.
Lastly it may be tricky to add a new directory structure to the PMU
entry as it is generic for all PMUs in the system. But that is up for
investigation and I will look into doing something like that.
Btw, I am always inclined to using some bits off one of the "config" fields
("config1" or "config2") for the sink configuration. But I understand that
you have explored that avenue and chose this approach as we have further
configurations required for complex ETM settings.
I've had a good conversation with myself over the holidays on that
topic (hence the late-ish reply). My original approach was to use the
same ioctl() mechanism to do sink selection and complex PMU
configuration. But as Greg confirmed with his comment on the previous
patch doing so requires to iron out how the latter will be done on ARM
(and probably on Intel too), something that is a different deal
altogether.
Taking a step back and forgetting about complex PMU configuration for
a minute, the ID of a sink can easily be stuffed in one of the
"config" fields of the perf_event_attr structure, something I alluded
to in the patchset's cover letter. That way we can move along with
this feature and leave the discussion on complex PMU configuration for
another day.
I'll do a respin with the above in mind.
A happy new year to you,