From: Suzuki K Poulose <suzuki.poulose@arm.com>
To: mathieu.poirier@linaro.org
Cc: mark.rutland@arm.com, linux-s390@vger.kernel.org,
Suzuki.Poulose@arm.com, peterz@infradead.org,
gregkh@linuxfoundation.org, heiko.carstens@de.ibm.com,
adrian.hunter@intel.com, acme@kernel.org, ast@kernel.org,
alexander.shishkin@linux.intel.com, mingo@redhat.com,
will.deacon@arm.com, hpa@zytor.com, schwidefsky@de.ibm.com,
namhyung@kernel.org, tglx@linutronix.de, jolsa@redhat.com,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [RESEND PATCH v5 4/6] coresight: Use PMU driver configuration for sink selection
Date: Wed, 9 Jan 2019 14:55:44 +0000 [thread overview]
Message-ID: <b082bf81-2148-2b43-5b1a-0bdf4b1e62c0@arm.com> (raw)
In-Reply-To: <CANLsYkx_-QHs=3syOXrazU_nA2x-QT9VjvzWubGjVGtz_01dAQ@mail.gmail.com>
Hi Mathieu,
On 07/01/2019 18:18, Mathieu Poirier wrote:
> On Wed, 19 Dec 2018 at 02:40, Suzuki K Poulose <suzuki.poulose@arm.com> 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@arm.com> 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.
I would recommend this be done by the PMU driver and expose it, rather
than specifying what is expected. If we keep it simple like an integer,
which is then mapped to the sink-device, we could save some bits in the
config field for further use and a the complex set of rules for the ID.
>
> 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.
I don't think this is particularly problematic. The PMU driver can provide
a list of attribute_groups which should eventually appear in the device
directory under the "bus/event_source/devices/<PMU>/". And that provides
a central place for finding the SINK id for all the available sinks, rather
than scanning for a sink under all the buses (e.g, platform, amba) wherever
that might show up.
>
>>
>> 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.
Cool ! I completely agree with this.
>
> I'll do a respin with the above in mind.
>
> A happy new year to you,
You too.
Cheers
Suzuki
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-01-09 14:55 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-17 17:21 [RESEND PATCH v5 0/6] perf: Add ioctl for PMU driver configuration Mathieu Poirier
2018-12-17 17:21 ` [RESEND PATCH v5 1/6] perf: Introduce ioctl to communicate driver configuration to kernel Mathieu Poirier
2018-12-19 8:29 ` Greg KH
2018-12-17 17:21 ` [RESEND PATCH v5 2/6] perf/core: Use " Mathieu Poirier
2018-12-19 8:31 ` Greg KH
2018-12-24 0:52 ` [LKP] [perf/core] fae9e65dbd: BUG:kernel_reboot-without-warning_in_early-boot_stage, last_printk:early_console_in_setup_code kernel test robot
2018-12-17 17:21 ` [RESEND PATCH v5 3/6] perf/aux: Make perf_event accessible to setup_aux() Mathieu Poirier
2018-12-17 17:21 ` [RESEND PATCH v5 4/6] coresight: Use PMU driver configuration for sink selection Mathieu Poirier
2018-12-18 14:14 ` Suzuki K Poulose
2018-12-18 15:21 ` Alexander Shishkin
2018-12-18 18:20 ` Mathieu Poirier
2018-12-18 17:34 ` Mathieu Poirier
2018-12-19 9:40 ` Suzuki K Poulose
2019-01-07 18:18 ` Mathieu Poirier
2019-01-09 14:55 ` Suzuki K Poulose [this message]
2018-12-17 17:21 ` [RESEND PATCH v5 5/6] perf tools: Make perf_evsel accessible to PMU driver configuration code Mathieu Poirier
2018-12-17 17:21 ` [RESEND PATCH v5 6/6] perf tools: Use ioctl function to send sink information to kernel Mathieu Poirier
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=b082bf81-2148-2b43-5b1a-0bdf4b1e62c0@arm.com \
--to=suzuki.poulose@arm.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=ast@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=heiko.carstens@de.ibm.com \
--cc=hpa@zytor.com \
--cc=jolsa@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.poirier@linaro.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=schwidefsky@de.ibm.com \
--cc=tglx@linutronix.de \
--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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox