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: <CAM9d7cg7dLNyH=dYuie=HF=yfxH7dNaEe5vs+r0E_PJLYs1Msw@mail.gmail.com>
Date:   Tue, 4 Oct 2022 11:34:45 -0700
From:   Namhyung Kim <namhyung@...nel.org>
To:     Ravi Bangoria <ravi.bangoria@....com>
Cc:     Leo Yan <leo.yan@...aro.org>,
        Arnaldo Carvalho de Melo <acme@...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>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        linux-perf-users <linux-perf-users@...r.kernel.org>
Subject: Re: [PATCH v4] perf test: Introduce script for data symbol testing

On Fri, Sep 30, 2022 at 10:13 PM Ravi Bangoria <ravi.bangoria@....com> wrote:
>
> >> +# perf mem/c2c internally uses IBS PMU on AMD CPU which doesn't support
> >> +# user/kernel filtering and per-process monitoring, spin program on
> >> +# specific CPU and test in per-CPU mode.
> >> +is_amd=$(egrep -c 'vendor_id.*AuthenticAMD' /proc/cpuinfo)
> >> +if (($is_amd >= 1)); then
> >> +       perf mem record -o ${PERF_DATA} -- -C 0 -- taskset -c 0 $TEST_PROGRAM &
> >
> > I'm curious why it has "--" before "-C 0"..
>
> IIRC, any command line options placed after -- will be carry forwarded
> as is to perf record.
>
> perf mem record [options] does not support -C option. Which means -C 0
> will be ignored if user run `perf mem record -C 0`. Ex:
>
>   $ sudo ./perf --debug perf-event-open mem record -C 0
>   [...]
>   sys_perf_event_open: pid -1  cpu 0  group_fd -1  flags 0 = 5
>   sys_perf_event_open: pid -1  cpu 1  group_fd -1  flags 0 = 6
>   sys_perf_event_open: pid -1  cpu 2  group_fd -1  flags 0 = 7
>   sys_perf_event_open: pid -1  cpu 3  group_fd -1  flags 0 = 8
>
> OTOH, if I place -C 0 after -- then perf opens event only on cpu0:
>
>   $ sudo ./perf --debug perf-event-open mem record -- -C 0
>   [...]
>   sys_perf_event_open: pid -1  cpu 0  group_fd -1  flags 0 = 7
>
> Now, perf mem [options] supports -C options but I don't know why
> it's not working for me:

Thanks for checking this!

It seems -C works only for perf mem report and eats it for record.
I think we need to fix the option handling.

Thanks,
Namhyung


>
>   $ sudo ./perf --debug perf-event-open mem -C 0 record
>   [...]
>   sys_perf_event_open: pid -1  cpu 0  group_fd -1  flags 0 = 5
>   sys_perf_event_open: pid -1  cpu 1  group_fd -1  flags 0 = 6
>   sys_perf_event_open: pid -1  cpu 2  group_fd -1  flags 0 = 7
>   sys_perf_event_open: pid -1  cpu 3  group_fd -1  flags 0 = 8
>
> Thanks,
> Ravi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ