linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ravi Bangoria <ravi.bangoria@amd.com>
To: Namhyung Kim <namhyung@kernel.org>, Leo Yan <leo.yan@linaro.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-perf-users <linux-perf-users@vger.kernel.org>,
	Ravi Bangoria <ravi.bangoria@amd.com>
Subject: Re: [PATCH v4] perf test: Introduce script for data symbol testing
Date: Sat, 1 Oct 2022 10:43:10 +0530	[thread overview]
Message-ID: <c75ba6c3-938d-14a5-2fc8-3e846eeba23f@amd.com> (raw)
In-Reply-To: <CAM9d7cibbdOb04qhKkfyRmwtHvttb6-bOu_uAN6D8ke-EJUWZw@mail.gmail.com>

>> +# 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:

  $ 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

  reply	other threads:[~2022-10-01  5:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-30 12:09 [PATCH v4] perf test: Introduce script for data symbol testing Leo Yan
2022-09-30 16:47 ` Namhyung Kim
2022-10-01  5:13   ` Ravi Bangoria [this message]
2022-10-04 18:34     ` Namhyung Kim
2022-10-06  6:03       ` Leo Yan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c75ba6c3-938d-14a5-2fc8-3e846eeba23f@amd.com \
    --to=ravi.bangoria@amd.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=leo.yan@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).