linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ravi Bangoria <ravi.bangoria@amd.com>
To: peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org
Cc: acme@kernel.org, eranian@google.com, mark.rutland@arm.com,
	alexander.shishkin@linux.intel.com, jolsa@kernel.org,
	irogers@google.com, adrian.hunter@intel.com,
	kan.liang@linux.intel.com, tglx@linutronix.de, bp@alien8.de,
	dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	santosh.shukla@amd.com, ananth.narayan@amd.com,
	sandipan.das@amd.com, Ravi Bangoria <ravi.bangoria@amd.com>
Subject: Re: [PATCH v2 10/10] perf test amd ibs: Add sample period unit test
Date: Fri, 6 Dec 2024 10:54:59 +0530	[thread overview]
Message-ID: <cf12a0c4-21bd-4568-9dc8-daaa2392bd94@amd.com> (raw)
In-Reply-To: <20241206051713.991-11-ravi.bangoria@amd.com>

On 06-Dec-24 10:47 AM, Ravi Bangoria wrote:
> IBS Fetch and IBS Op pmus has various constraints on supported sample
> periods. Add perf unit tests to test those.
> 
> Running it in parallel with other tests causes intermittent failures.
> Mark it exclusive to force it to run sequentially.

The verbose mode of unit test is quite exhaustive so I've not added it
in the commit description. Here is the sample output on a Zen5 machine:

Without patches:

  $ sudo ./perf test -vv 112
   75: AMD IBS sample period:
  --- start ---
  test child forked, pid 7368
  Using CPUID AuthenticAMD-26-2-1
  
  IBS config tests:
  -----------------
  Fetch PMU tests:
  0xffff            : Ok   (nr samples: 1224)
  0x1000            : Ok   (nr samples: 19866)
  0xff              : Ok   (nr samples: 40738)
  0x1               : Ok   (nr samples: 40945)
  0x0               : Ok
  0x10000           : Ok
  Op PMU tests:
  0x0               : Ok
  0x1               : Fail
  0x8               : Fail
  0x9               : Ok   (nr samples: 40543)
  0xf               : Ok   (nr samples: 40543)
  0x1000            : Ok   (nr samples: 20267)
  0xffff            : Ok   (nr samples: 1289)
  0x10000           : Ok
  0x100000          : Fail (nr samples: 17)
  0xf00000          : Fail (nr samples: 1)
  0xf0ffff          : Fail (nr samples: 1)
  0x1f0ffff         : Fail (nr samples: 1)
  0x7f0ffff         : Fail (nr samples: 0)
  0x8f0ffff         : Ok
  0x17f0ffff        : Ok
  
  IBS sample period constraint tests:
  -----------------------------------
  Fetch PMU test:
  freq 0, sample_freq       0: Ok
  freq 0, sample_freq       1: Fail
  freq 0, sample_freq      15: Fail
  freq 0, sample_freq      16: Ok   (nr samples: 1604)
  freq 0, sample_freq      17: Ok   (nr samples: 1604)
  freq 0, sample_freq     143: Ok   (nr samples: 1232)
  freq 0, sample_freq     144: Ok   (nr samples: 1274)
  freq 0, sample_freq     145: Ok   (nr samples: 1241)
  freq 0, sample_freq    1234: Ok   (nr samples: 1261)
  freq 0, sample_freq   65520: Ok   (nr samples: 2660)
  freq 0, sample_freq   65535: Ok   (nr samples: 2635)
  freq 0, sample_freq   65552: Ok   (nr samples: 2633)
  freq 0, sample_freq 8388607: Ok   (nr samples: 31)
  freq 1, sample_freq       0: Ok
  freq 1, sample_freq       1: Ok   (nr samples: 4)
  freq 1, sample_freq      15: Ok   (nr samples: 4)
  freq 1, sample_freq      16: Ok   (nr samples: 4)
  freq 1, sample_freq      17: Ok   (nr samples: 4)
  freq 1, sample_freq     143: Ok   (nr samples: 5)
  freq 1, sample_freq     144: Ok   (nr samples: 5)
  freq 1, sample_freq     145: Ok   (nr samples: 5)
  freq 1, sample_freq    1234: Ok   (nr samples: 8)
  freq 1, sample_freq   65520: Ok   (nr samples: 541)
  freq 1, sample_freq   65535: Ok   (nr samples: 622)
  freq 1, sample_freq   65552: Ok   (nr samples: 720)
  freq 1, sample_freq 8388607: Ok
  Op PMU test:
  freq 0, sample_freq       0: Ok
  freq 0, sample_freq       1: Fail
  freq 0, sample_freq      15: Fail
  freq 0, sample_freq      16: Fail
  freq 0, sample_freq      17: Fail
  freq 0, sample_freq     143: Fail
  freq 0, sample_freq     144: Ok   (nr samples: 2005)
  freq 0, sample_freq     145: Ok   (nr samples: 1604)
  freq 0, sample_freq    1234: Ok   (nr samples: 1604)
  freq 0, sample_freq   65520: Ok   (nr samples: 2547)
  freq 0, sample_freq   65535: Ok   (nr samples: 2532)
  freq 0, sample_freq   65552: Ok   (nr samples: 2469)
  freq 0, sample_freq 8388607: Ok   (nr samples: 30)
  freq 1, sample_freq       0: Ok
  freq 1, sample_freq       1: Fail (nr samples: 4)
  freq 1, sample_freq      15: Fail (nr samples: 4)
  freq 1, sample_freq      16: Fail (nr samples: 4)
  freq 1, sample_freq      17: Fail (nr samples: 4)
  freq 1, sample_freq     143: Fail (nr samples: 5)
  freq 1, sample_freq     144: Fail (nr samples: 5)
  freq 1, sample_freq     145: Fail (nr samples: 5)
  freq 1, sample_freq    1234: Fail (nr samples: 6)
  freq 1, sample_freq   65520: Fail (nr samples: 602)
  freq 1, sample_freq   65535: Fail (nr samples: 618)
  freq 1, sample_freq   65552: Fail (nr samples: 622)
  freq 1, sample_freq 8388607: Ok
  
  IBS ioctl() tests:
  ------------------
  Fetch PMU tests
  ioctl(period = 0x0      ): Ok
  ioctl(period = 0x1      ): Fail
  ioctl(period = 0xf      ): Fail
  ioctl(period = 0x10     ): Ok
  ioctl(period = 0x11     ): Fail
  ioctl(period = 0x1f     ): Fail
  ioctl(period = 0x20     ): Ok
  ioctl(period = 0x80     ): Ok
  ioctl(period = 0x8f     ): Fail
  ioctl(period = 0x90     ): Ok
  ioctl(period = 0x91     ): Fail
  ioctl(period = 0x100    ): Ok
  ioctl(period = 0xfff0   ): Ok
  ioctl(period = 0xffff   ): Fail
  ioctl(period = 0x10000  ): Ok
  ioctl(period = 0x1fff0  ): Ok
  ioctl(period = 0x1fff5  ): Fail
  ioctl(freq   = 0x0      ): Ok
  ioctl(freq   = 0x1      ): Ok
  ioctl(freq   = 0xf      ): Ok
  ioctl(freq   = 0x10     ): Ok
  ioctl(freq   = 0x11     ): Ok
  ioctl(freq   = 0x1f     ): Ok
  ioctl(freq   = 0x20     ): Ok
  ioctl(freq   = 0x80     ): Ok
  ioctl(freq   = 0x8f     ): Ok
  ioctl(freq   = 0x90     ): Ok
  ioctl(freq   = 0x91     ): Ok
  ioctl(freq   = 0x100    ): Ok
  Op PMU tests
  ioctl(period = 0x0      ): Ok
  ioctl(period = 0x1      ): Fail
  ioctl(period = 0xf      ): Fail
  ioctl(period = 0x10     ): Fail
  ioctl(period = 0x11     ): Fail
  ioctl(period = 0x1f     ): Fail
  ioctl(period = 0x20     ): Fail
  ioctl(period = 0x80     ): Fail
  ioctl(period = 0x8f     ): Fail
  ioctl(period = 0x90     ): Ok
  ioctl(period = 0x91     ): Fail
  ioctl(period = 0x100    ): Ok
  ioctl(period = 0xfff0   ): Ok
  ioctl(period = 0xffff   ): Fail
  ioctl(period = 0x10000  ): Ok
  ioctl(period = 0x1fff0  ): Ok
  ioctl(period = 0x1fff5  ): Fail
  ioctl(freq   = 0x0      ): Ok
  ioctl(freq   = 0x1      ): Ok
  ioctl(freq   = 0xf      ): Ok
  ioctl(freq   = 0x10     ): Ok
  ioctl(freq   = 0x11     ): Ok
  ioctl(freq   = 0x1f     ): Ok
  ioctl(freq   = 0x20     ): Ok
  ioctl(freq   = 0x80     ): Ok
  ioctl(freq   = 0x8f     ): Ok
  ioctl(freq   = 0x90     ): Ok
  ioctl(freq   = 0x91     ): Ok
  ioctl(freq   = 0x100    ): Ok
  
  IBS freq (negative) tests:
  --------------------------
  freq 1, sample_freq 200000: Fail
  
  IBS L3MissOnly test: (takes a while)
  --------------------
  Fetch L3MissOnly: Fail (nr_samples: 1159)
  Op L3MissOnly:    Ok   (nr_samples: 1205)
  ---- end(-1) ----
   75: AMD IBS sample period                                           : FAILED!


With patches:

  $ sudo ./perf test -vv 112
  112: AMD IBS sample period:
  --- start ---
  test child forked, pid 44042
  Using CPUID AuthenticAMD-26-2-1
  
  IBS config tests:
  -----------------
  Fetch PMU tests:
  0xffff            : Ok   (nr samples: 1278)
  0x1000            : Ok   (nr samples: 20129)
  0xff              : Ok   (nr samples: 40529)
  0x1               : Ok   (nr samples: 40443)
  0x0               : Ok
  0x10000           : Ok
  Op PMU tests:
  0x0               : Ok
  0x1               : Ok
  0x8               : Ok
  0x9               : Ok   (nr samples: 40443)
  0xf               : Ok   (nr samples: 40761)
  0x1000            : Ok   (nr samples: 20808)
  0xffff            : Ok   (nr samples: 1261)
  0x10000           : Ok
  0x100000          : Ok   (nr samples: 1276)
  0xf00000          : Ok   (nr samples: 87)
  0xf0ffff          : Ok   (nr samples: 77)
  0x1f0ffff         : Ok   (nr samples: 39)
  0x7f0ffff         : Ok   (nr samples: 8)
  0x8f0ffff         : Ok
  0x17f0ffff        : Ok
  
  IBS sample period constraint tests:
  -----------------------------------
  Fetch PMU test:
  freq 0, sample_freq       0: Ok
  freq 0, sample_freq       1: Ok
  freq 0, sample_freq      15: Ok
  freq 0, sample_freq      16: Ok   (nr samples: 1272)
  freq 0, sample_freq      17: Ok   (nr samples: 1272)
  freq 0, sample_freq     143: Ok   (nr samples: 1590)
  freq 0, sample_freq     144: Ok   (nr samples: 1272)
  freq 0, sample_freq     145: Ok   (nr samples: 1272)
  freq 0, sample_freq    1234: Ok   (nr samples: 1272)
  freq 0, sample_freq    4103: Ok   (nr samples: 1272)
  freq 0, sample_freq   65520: Ok   (nr samples: 2530)
  freq 0, sample_freq   65535: Ok   (nr samples: 2339)
  freq 0, sample_freq   65552: Ok   (nr samples: 2546)
  freq 0, sample_freq 8388607: Ok   (nr samples: 30)
  freq 1, sample_freq       0: Ok
  freq 1, sample_freq       1: Ok   (nr samples: 4)
  freq 1, sample_freq      15: Ok   (nr samples: 4)
  freq 1, sample_freq      16: Ok   (nr samples: 4)
  freq 1, sample_freq      17: Ok   (nr samples: 4)
  freq 1, sample_freq     143: Ok   (nr samples: 5)
  freq 1, sample_freq     144: Ok   (nr samples: 5)
  freq 1, sample_freq     145: Ok   (nr samples: 5)
  freq 1, sample_freq    1234: Ok   (nr samples: 9)
  freq 1, sample_freq    4103: Ok   (nr samples: 36)
  freq 1, sample_freq   65520: Ok   (nr samples: 954)
  freq 1, sample_freq   65535: Ok   (nr samples: 1590)
  freq 1, sample_freq   65552: Ok   (nr samples: 1272)
  freq 1, sample_freq 8388607: Ok
  Op PMU test:
  freq 0, sample_freq       0: Ok
  freq 0, sample_freq       1: Ok
  freq 0, sample_freq      15: Ok
  freq 0, sample_freq      16: Ok
  freq 0, sample_freq      17: Ok
  freq 0, sample_freq     143: Ok
  freq 0, sample_freq     144: Ok   (nr samples: 1272)
  freq 0, sample_freq     145: Ok   (nr samples: 1272)
  freq 0, sample_freq    1234: Ok   (nr samples: 1272)
  freq 0, sample_freq    4103: Ok   (nr samples: 1272)
  freq 0, sample_freq   65520: Ok   (nr samples: 2599)
  freq 0, sample_freq   65535: Ok   (nr samples: 2558)
  freq 0, sample_freq   65552: Ok   (nr samples: 2480)
  freq 0, sample_freq 8388607: Ok   (nr samples: 31)
  freq 1, sample_freq       0: Ok
  freq 1, sample_freq       1: Ok   (nr samples: 4)
  freq 1, sample_freq      15: Ok   (nr samples: 4)
  freq 1, sample_freq      16: Ok   (nr samples: 4)
  freq 1, sample_freq      17: Ok   (nr samples: 4)
  freq 1, sample_freq     143: Ok   (nr samples: 5)
  freq 1, sample_freq     144: Ok   (nr samples: 5)
  freq 1, sample_freq     145: Ok   (nr samples: 5)
  freq 1, sample_freq    1234: Ok   (nr samples: 8)
  freq 1, sample_freq    4103: Ok   (nr samples: 30)
  freq 1, sample_freq   65520: Ok   (nr samples: 577)
  freq 1, sample_freq   65535: Ok   (nr samples: 585)
  freq 1, sample_freq   65552: Ok   (nr samples: 577)
  freq 1, sample_freq 8388607: Ok
  
  IBS ioctl() tests:
  ------------------
  Fetch PMU tests
  ioctl(period = 0x0      ): Ok
  ioctl(period = 0x1      ): Ok
  ioctl(period = 0xf      ): Ok
  ioctl(period = 0x10     ): Ok
  ioctl(period = 0x11     ): Ok
  ioctl(period = 0x1f     ): Ok
  ioctl(period = 0x20     ): Ok
  ioctl(period = 0x80     ): Ok
  ioctl(period = 0x8f     ): Ok
  ioctl(period = 0x90     ): Ok
  ioctl(period = 0x91     ): Ok
  ioctl(period = 0x100    ): Ok
  ioctl(period = 0xfff0   ): Ok
  ioctl(period = 0xffff   ): Ok
  ioctl(period = 0x10000  ): Ok
  ioctl(period = 0x1fff0  ): Ok
  ioctl(period = 0x1fff5  ): Ok
  ioctl(freq   = 0x0      ): Ok
  ioctl(freq   = 0x1      ): Ok
  ioctl(freq   = 0xf      ): Ok
  ioctl(freq   = 0x10     ): Ok
  ioctl(freq   = 0x11     ): Ok
  ioctl(freq   = 0x1f     ): Ok
  ioctl(freq   = 0x20     ): Ok
  ioctl(freq   = 0x80     ): Ok
  ioctl(freq   = 0x8f     ): Ok
  ioctl(freq   = 0x90     ): Ok
  ioctl(freq   = 0x91     ): Ok
  ioctl(freq   = 0x100    ): Ok
  Op PMU tests
  ioctl(period = 0x0      ): Ok
  ioctl(period = 0x1      ): Ok
  ioctl(period = 0xf      ): Ok
  ioctl(period = 0x10     ): Ok
  ioctl(period = 0x11     ): Ok
  ioctl(period = 0x1f     ): Ok
  ioctl(period = 0x20     ): Ok
  ioctl(period = 0x80     ): Ok
  ioctl(period = 0x8f     ): Ok
  ioctl(period = 0x90     ): Ok
  ioctl(period = 0x91     ): Ok
  ioctl(period = 0x100    ): Ok
  ioctl(period = 0xfff0   ): Ok
  ioctl(period = 0xffff   ): Ok
  ioctl(period = 0x10000  ): Ok
  ioctl(period = 0x1fff0  ): Ok
  ioctl(period = 0x1fff5  ): Ok
  ioctl(freq   = 0x0      ): Ok
  ioctl(freq   = 0x1      ): Ok
  ioctl(freq   = 0xf      ): Ok
  ioctl(freq   = 0x10     ): Ok
  ioctl(freq   = 0x11     ): Ok
  ioctl(freq   = 0x1f     ): Ok
  ioctl(freq   = 0x20     ): Ok
  ioctl(freq   = 0x80     ): Ok
  ioctl(freq   = 0x8f     ): Ok
  ioctl(freq   = 0x90     ): Ok
  ioctl(freq   = 0x91     ): Ok
  ioctl(freq   = 0x100    ): Ok
  
  IBS freq (negative) tests:
  --------------------------
  freq 1, sample_freq 200000: Ok
  
  IBS L3MissOnly test: (takes a while)
  --------------------
  Fetch L3MissOnly: Ok   (nr_samples: 1408)
  Op L3MissOnly:    Ok   (nr_samples: 1456)
  ---- end(0) ----
  112: AMD IBS sample period                                           : Ok

Thanks,
Ravi

  reply	other threads:[~2024-12-06  5:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-06  5:17 [PATCH v2 00/10] perf/amd/ibs: Fix sample period computations Ravi Bangoria
2024-12-06  5:17 ` [PATCH v2 01/10] perf/amd/ibs: Remove IBS_{FETCH|OP}_CONFIG_MASK macros Ravi Bangoria
2024-12-06  5:17 ` [PATCH v2 02/10] perf/amd/ibs: Remove pointless sample period check Ravi Bangoria
2024-12-06  5:17 ` [PATCH v2 03/10] perf/amd/ibs: Fix ->config to sample period calculation for OP pmu Ravi Bangoria
2024-12-06  5:17 ` [PATCH v2 04/10] perf/amd/ibs: Fix perf_ibs_op.cnt_mask for CurCnt Ravi Bangoria
2024-12-06  5:17 ` [PATCH v2 05/10] perf/amd/ibs: Don't allow freq mode event creation through ->config interface Ravi Bangoria
2024-12-06  8:47   ` Ingo Molnar
2024-12-06  9:07     ` Ravi Bangoria
2024-12-06  9:22       ` Ingo Molnar
2024-12-06  9:38         ` Ravi Bangoria
2024-12-06  5:17 ` [PATCH v2 06/10] perf/amd/ibs: Add pmu specific minimum period Ravi Bangoria
2024-12-06  8:42   ` Ingo Molnar
2024-12-06  8:47     ` Ravi Bangoria
2024-12-06  5:17 ` [PATCH v2 07/10] perf/amd/ibs: Add ->check_period() callback Ravi Bangoria
2024-12-06  5:17 ` [PATCH v2 08/10] perf/core: Introduce pmu->adjust_period() callback Ravi Bangoria
2024-12-06  5:17 ` [PATCH v2 09/10] perf test: Introduce DEFINE_SUITE_EXCLUSIVE() Ravi Bangoria
2024-12-06  5:17 ` [PATCH v2 10/10] perf test amd ibs: Add sample period unit test Ravi Bangoria
2024-12-06  5:24   ` Ravi Bangoria [this message]
2024-12-06  8:43     ` Ingo Molnar

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=cf12a0c4-21bd-4568-9dc8-daaa2392bd94@amd.com \
    --to=ravi.bangoria@amd.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=ananth.narayan@amd.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=eranian@google.com \
    --cc=hpa@zytor.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --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 \
    --cc=sandipan.das@amd.com \
    --cc=santosh.shukla@amd.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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).