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: <9fde1c3a-3fdb-b2b7-7448-8de608853bd2@linux.intel.com>
Date:   Mon, 4 Jul 2022 09:22:06 -0400
From:   "Liang, Kan" <kan.liang@...ux.intel.com>
To:     zhengjun.xing@...ux.intel.com, acme@...nel.org,
        peterz@...radead.org, mingo@...hat.com,
        alexander.shishkin@...el.com, jolsa@...nel.org, namhyung@...nel.org
Cc:     linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
        irogers@...gle.com, ak@...ux.intel.com,
        Adrian Hunter <adrian.hunter@...el.com>
Subject: Re: [PATCH 1/2] perf record: Fix "--per-thread" option for hybrid
 machines



On 7/1/2022 10:35 PM, zhengjun.xing@...ux.intel.com wrote:
> From: Zhengjun Xing <zhengjun.xing@...ux.intel.com>
> 
> Commit b91e5492f9d7 ("perf record: Add a dummy event on hybrid systems to
> collect metadata records") adds a dummy event on hybrid systems to fix the
> symbol "unknown" issue when the workload is created in a P-core but runs
> on an E-core. When "--per-thread" is enabled, the nr_cpus is reduced to 1,
>   adding a dummy event is useless for this issue, and it will also cause

A dummy event is required since a mmap event may be loaded at runtime on 
any CPU. Thanks Adrian to point it out.

Thanks,
Kan

> "failed to mmap with 22 (Invalid argument)". This patch stops adding dummy
> events when the option "--per-thread" is enabled, then the option can work
> on hybrid machines.
> 
> Before:
> 
>   # ./perf record -e cycles:u --per-thread  sleep 1
>   failed to mmap with 22 (Invalid argument)
> 
> After:
> 
>   # ./perf record -e cycles:u --per-thread  sleep 1
> [ perf record: Woken up 1 times to write data ]
> [ perf record: Captured and wrote 0.002 MB perf.data (6 samples) ]
> 
> Fixes: b91e5492f9d7 ("perf record: Add a dummy event on hybrid systems to collect metadata records")
> Signed-off-by: Zhengjun Xing <zhengjun.xing@...ux.intel.com>
> Reviewed-by: Kan Liang <kan.liang@...ux.intel.com>
> ---
>   tools/perf/builtin-record.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
> index e1edd4e98358..44ea2dd424fe 100644
> --- a/tools/perf/builtin-record.c
> +++ b/tools/perf/builtin-record.c
> @@ -1223,7 +1223,7 @@ static int record__open(struct record *rec)
>   	 * of waiting or event synthesis.
>   	 */
>   	if (opts->initial_delay || target__has_cpu(&opts->target) ||
> -	    perf_pmu__has_hybrid()) {
> +	    (perf_pmu__has_hybrid() && !opts->target.per_thread)) {
>   		pos = evlist__get_tracking_event(evlist);
>   		if (!evsel__is_dummy_event(pos)) {
>   			/* Set up dummy event. */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ