lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <767745f1-4d79-17f1-6c5f-a4b352b8a40f@arm.com>
Date:   Mon, 16 Oct 2023 10:15:07 +0100
From:   Suzuki K Poulose <suzuki.poulose@....com>
To:     Leo Yan <leo.yan@...aro.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        James Clark <james.clark@....com>,
        Mike Leach <mike.leach@...aro.org>
Cc:     John Garry <john.g.garry@...cle.com>,
        Will Deacon <will@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Ian Rogers <irogers@...gle.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        coresight@...ts.linaro.org, linux-arm-kernel@...ts.infradead.org,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 RESEND 1/2] perf cs-etm: Validate timestamp tracing in
 per-thread mode

On 14/10/2023 08:41, Leo Yan wrote:
> So far, it's impossible to validate timestamp trace in Arm CoreSight when
> the perf is in the per-thread mode.  E.g. for the command:
> 
>    perf record -e cs_etm/timestamp/ --per-thread -- ls
> 
> The command enables config 'timestamp' for 'cs_etm' event in the
> per-thread mode.  In this case, the function cs_etm_validate_config()
> directly bails out and skips validation.
> 
> Given profiled process can be scheduled on any CPUs in the per-thread
> mode, this patch validates timestamp tracing for all CPUs when detect
> the CPU map is empty.
> 
> Signed-off-by: Leo Yan <leo.yan@...aro.org>
> Reviewed-by: James Clark <james.clark@....com>

> ---
>   tools/perf/arch/arm/util/cs-etm.c | 13 +++++++++++--
>   1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c
> index b8d6a953fd74..cf9ef9ba800b 100644
> --- a/tools/perf/arch/arm/util/cs-etm.c
> +++ b/tools/perf/arch/arm/util/cs-etm.c
> @@ -205,8 +205,17 @@ static int cs_etm_validate_config(struct auxtrace_record *itr,
>   	for (i = 0; i < cpu__max_cpu().cpu; i++) {
>   		struct perf_cpu cpu = { .cpu = i, };
>   
> -		if (!perf_cpu_map__has(event_cpus, cpu) ||
> -		    !perf_cpu_map__has(online_cpus, cpu))
> +		/*
> +		 * In per-cpu case, do the validation for CPUs to work with.
> +		 * In per-thread case, the CPU map is empty.  Since the traced
> +		 * program can run on any CPUs in this case, thus don't skip
> +		 * validation.
> +		 */
> +		if (!perf_cpu_map__empty(event_cpus) &&
> +		    !perf_cpu_map__has(event_cpus, cpu))
> +			continue;
> +
> +		if (!perf_cpu_map__has(online_cpus, cpu))
>   			continue;
>   

Acked-by: Suzuki K Poulose <suzuki.poulose@....com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ