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] [day] [month] [year] [list]
Message-ID: <aCIj7fggPPbu2xgV@x1>
Date: Mon, 12 May 2025 13:38:05 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Adrian Hunter <adrian.hunter@...el.com>
Cc: Jiri Olsa <jolsa@...nel.org>, Namhyung Kim <namhyung@...nel.org>,
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
	Ian Rogers <irogers@...gle.com>,
	Kan Liang <kan.liang@...ux.intel.com>, linux-kernel@...r.kernel.org,
	linux-perf-users@...r.kernel.org
Subject: Re: [PATCH 2/3] perf intel-pt: Do not default to recording all
 switch events

On Mon, May 12, 2025 at 12:39:31PM +0300, Adrian Hunter wrote:
> On systems with many CPUs, recording extra context switch events can be
> excessive and unnecessary. Add perf config intel-pt.all-switch-events=false
> to control the behaviour.
> 
> Example:
> 
>  # perf config intel-pt.all-switch-events=false
>  # perf record -eintel_pt//u uname
>  Linux
>  [ perf record: Woken up 1 times to write data ]
>  [ perf record: Captured and wrote 0.082 MB perf.data ]
>  # perf script -D | grep PERF_RECORD_SWITCH | awk '{print $5}' | uniq -c
>        5 PERF_RECORD_SWITCH
>  # perf config intel-pt.all-switch-events=true
>  # perf record -eintel_pt//u uname
>  Linux
>  [ perf record: Woken up 1 times to write data ]
>  [ perf record: Captured and wrote 0.102 MB perf.data ]
>  # perf script -D | grep PERF_RECORD_SWITCH | awk '{print $5}' | uniq -c
>      180 PERF_RECORD_SWITCH_CPU_WIDE

Thanks, tested and applied the series.

BTW, I used 'perf report --stats' that shows the number of PERF_RECORD_
events:

Committer testing:

While doing a make -j28 allmodconfig:

  root@...e:~# grep "model name" -m1 /proc/cpuinfo
  model name    : Intel(R) Core(TM) i7-14700K
  root@...e:~#
  root@...e:~# perf config intel-pt.all-switch-events=false
  root@...e:~# perf record -e intel_pt//u uname
  Linux
  [ perf record: Woken up 2 times to write data ]
  [ perf record: Captured and wrote 0.019 MB perf.data ]
  root@...e:~# perf report --stats | grep SWITCH_CPU_WIDE
  root@...e:~# 
  root@...e:~# perf config intel-pt.all-switch-events=true
  root@...e:~# perf record -e intel_pt//u uname
  Linux
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.047 MB perf.data ]
  root@...e:~# perf report --stats | grep SWITCH_CPU_WIDE
       SWITCH_CPU_WIDE events:        542  (96.4%)
  root@...e:~#

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ