[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b923dcf3-1fbf-440e-9b45-9c6535d6a28b@nokia.com>
Date: Tue, 8 Oct 2024 15:18:01 +0200
From: Julien Meunier <julien.meunier@...ia.com>
To: Suzuki K Poulose <suzuki.poulose@....com>, Leo Yan <leo.yan@....com>,
Leo Yan <leo.yan@...ux.dev>
Cc: Mike Leach <mike.leach@...aro.org>, James Clark <james.clark@...aro.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
stable@...r.kernel.org, coresight@...ts.linaro.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] coresight: etm4x: Fix PID tracing when perf is run in an
init PID namespace
On 08/10/2024 11:59, Suzuki K Poulose wrote:
> On 08/10/2024 07:52, Leo Yan wrote:
>> On 10/7/2024 9:05 PM, Leo Yan wrote:
[...]
>>
>> I thought again and found I was wrong with above conclusion. This
>> patch is a
>> good fixing for the perf running in root namespace to profile programs in
>> non-root namespace. Sorry for noise.
>>
>> Maybe it is good to improve a bit comments to avoid confusion. See below.
>>
>> [...]
>>
>>>> diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/
>>>> drivers/hwtracing/coresight/coresight-etm4x-core.c
>>>> index bf01f01964cf..8365307b1aec 100644
>>>> --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c
>>>> +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c
>>>> @@ -695,7 +695,7 @@ static int etm4_parse_event_config(struct
>>>> coresight_device *csdev,
>>>>
>>>> /* Only trace contextID when runs in root PID namespace */
>>
>> We can claim the requirement for the *tool* running in root PID namespae.
>>
>> /* Only trace contextID when the tool runs in root PID namespace */
>
> minor nit: I wouldn't call "tool". Let keep it "event owner".
>
> /* Only trace contextID when the event owner is in root PID
> namespace */
>
>
> Julien,
>
> Please could you respin the patch with the comments addressed.
Sure, I will send a v2 with comments updated.
>
> Kind regards
> Suzuki
>
>
>>
>>
>>>> if ((attr->config & BIT(ETM_OPT_CTXTID)) &&
>>>> - task_is_in_init_pid_ns(current))
>>>> + task_is_in_init_pid_ns(event->owner))
>>>> /* bit[6], Context ID tracing bit */
>>>> config->cfg |= TRCCONFIGR_CID;
>>>>
>>>> @@ -710,7 +710,7 @@ static int etm4_parse_event_config(struct
>>>> coresight_device *csdev,
>>>> goto out;
>>>> }
>>>> /* Only trace virtual contextID when runs in root PID
>>>> namespace */
>>
>> Ditto.
>>
>> /* Only trace virtual contextID when the tool runs in root PID
>> namespace */
>>
>> With above change:
>>
>> Reviewed-by: Leo Yan <leo.yan@....com>
Regards,
Julien
Powered by blists - more mailing lists