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: <YT5qx4mhqOob1sMh@krava>
Date:   Sun, 12 Sep 2021 23:01:59 +0200
From:   Jiri Olsa <jolsa@...hat.com>
To:     Alexey Bayduraev <alexey.v.bayduraev@...ux.intel.com>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        Andi Kleen <ak@...ux.intel.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Alexander Antonov <alexander.antonov@...ux.intel.com>,
        Alexei Budankov <abudankov@...wei.com>,
        Riccardo Mancini <rickyman7@...il.com>
Subject: Re: [PATCH v11 13/24] perf record: Extend --threads command line
 option

On Tue, Aug 17, 2021 at 11:23:16AM +0300, Alexey Bayduraev wrote:
> Extend --threads option in perf record command line interface.
> The option can have a value in the form of masks that specify
> cpus to be monitored with data streaming threads and its layout
> in system topology. The masks can be filtered using cpu mask
> provided via -C option.
> 
> The specification value can be user defined list of masks. Masks
> separated by colon define cpus to be monitored by one thread and
> affinity mask of that thread is separated by slash. For example:
> <cpus mask 1>/<affinity mask 1>:<cpu mask 2>/<affinity mask 2>
> specifies parallel threads layout that consists of two threads
> with corresponding assigned cpus to be monitored.
> 
> The specification value can be a string e.g. "cpu", "core" or
> "socket" meaning creation of data streaming thread for every
> cpu or core or socket to monitor distinct cpus or cpus grouped
> by core or socket.
> 
> The option provided with no or empty value defaults to per-cpu
> parallel threads layout creating data streaming thread for every
> cpu being monitored.
> 
> Document --threads option syntax and parallel data streaming modes
> in Documentation/perf-record.txt.
> 
> Feature design and implementation are based on prototypes [1], [2].
> 
> [1] git clone https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git -b perf/record_threads
> [2] https://lore.kernel.org/lkml/20180913125450.21342-1-jolsa@kernel.org/
> 
> Suggested-by: Jiri Olsa <jolsa@...nel.org>
> Suggested-by: Namhyung Kim <namhyung@...nel.org>
> Acked-by: Andi Kleen <ak@...ux.intel.com>
> Acked-by: Namhyung Kim <namhyung@...il.com>
> Reviewed-by: Riccardo Mancini <rickyman7@...il.com>
> Tested-by: Riccardo Mancini <rickyman7@...il.com>
> Signed-off-by: Alexey Bayduraev <alexey.v.bayduraev@...ux.intel.com>
> ---
>  tools/perf/Documentation/perf-record.txt |  30 ++-
>  tools/perf/builtin-record.c              | 314 ++++++++++++++++++++++-
>  tools/perf/util/record.h                 |   1 +
>  3 files changed, 340 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt
> index 0408e677c117..4bbdc813e2e9 100644
> --- a/tools/perf/Documentation/perf-record.txt
> +++ b/tools/perf/Documentation/perf-record.txt
> @@ -695,9 +695,35 @@ measurements:
>   wait -n ${perf_pid}
>   exit $?
>  
> ---threads::
> +--threads=<spec>::
>  Write collected trace data into several data files using parallel threads.
> -The option creates a data streaming thread for each cpu in the system.
> +<spec> value can be user defined list of masks. Masks separated by colon
> +define cpus to be monitored by a thread and affinity mask of that thread
> +is separated by slash:
> +
> +    <cpus mask 1>/<affinity mask 1>:<cpus mask 2>/<affinity mask 2>:...
> +
> +For example user specification like the following:
> +
> +    0,2-4/2-4:1,5-7/5-7

is this special case?

[root@...va perf]# ./perf record --threads=1/1

[root@...va perf]# ps -ef | grep perf
root      132071  130979  9 22:59 pts/6    00:00:00 ./perf record --threads=1/1

[root@...va perf]# cat /proc/131798/task/*/status | grep Cpus_allowed
cat: '/proc/131798/task/*/status': No such file or directory
[root@...va perf]# cat /proc/132071/task/*/status | grep Cpus_allowed
Cpus_allowed:   ff
Cpus_allowed_list:      0-7
Cpus_allowed:   ff
Cpus_allowed_list:      0-7

looks like the affinity was not set

thanks,
jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ