linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ravi Bangoria <ravi.bangoria@amd.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Joe Mario <jmario@redhat.com>,
	Stephane Eranian <eranian@google.com>,
	Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	Santosh Shukla <santosh.shukla@amd.com>,
	Ananth Narayan <ananth.narayan@amd.com>,
	Sandipan Das <sandipan.das@amd.com>,
	Ravi Bangoria <ravi.bangoria@amd.com>
Subject: Re: [PATCH v4 1/4] perf amd ibs: Add Load Latency bits in raw dump
Date: Wed, 30 Apr 2025 23:15:52 +0530	[thread overview]
Message-ID: <573aeaa2-f99b-47fb-b9ac-1439f601e7e7@amd.com> (raw)
In-Reply-To: <aBJWvAQc0wF6EV9g@google.com>

Hi Namhyung,

>> +	# perf record -e ibs_op/ldlat=128/ -c 100000 -a
>> +
>> +	Supported load latency threshold values are 128 to 2048 (both inclusive).
> 
> What happens if user gives an out of range value?

Kernel returns error.

>>  static void pr_ibs_op_ctl(union ibs_op_ctl reg)
>>  {
>>  	char l3_miss_only[sizeof(" L3MissOnly _")] = "";
>> +	char ldlat[sizeof(" LdLatThrsh __ LdLatEn _")] = "";
> 
> Shouldn't it reserve 4 characters for the threshold since it can be up
> to 2048?

This function dumps HW register content. IBS_OP_CTL[LdLatThrsh] is a
4 bit field which should be programmed as:

  (actual threshold / 128) - 1

Valid values for LdLatThrsh are 0 to 15.

>>  	if (zen4_ibs_extensions)
>>  		snprintf(l3_miss_only, sizeof(l3_miss_only), " L3MissOnly %d", reg.l3_miss_only);
>>  
>> -	printf("ibs_op_ctl:\t%016llx MaxCnt %9d%s En %d Val %d CntCtl %d=%s CurCnt %9d\n",
>> +	if (ldlat_cap) {
>> +		snprintf(ldlat, sizeof(ldlat), " LdLatThrsh %2d LdLatEn %d",
> 
> Here, it would be %4d.

Since the valid values for LdLatThrsh are 0 to 15, two characters are
sufficient.

Thanks,
Ravi

  reply	other threads:[~2025-04-30 17:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-29  3:59 [PATCH v4 0/4] perf/amd/ibs: Add Zen5 support (tools changes) Ravi Bangoria
2025-04-29  3:59 ` [PATCH v4 1/4] perf amd ibs: Add Load Latency bits in raw dump Ravi Bangoria
2025-04-30 16:58   ` Namhyung Kim
2025-04-30 17:45     ` Ravi Bangoria [this message]
2025-04-29  3:59 ` [PATCH v4 2/4] perf amd ibs: Incorporate Zen5 DTLB and PageSize information Ravi Bangoria
2025-04-29  3:59 ` [PATCH v4 3/4] perf mem/c2c amd: Add ldlat support Ravi Bangoria
2025-04-29  3:59 ` [PATCH v4 4/4] perf test amd ibs: Add sample period unit test Ravi Bangoria
2025-04-29 20:55   ` Arnaldo Carvalho de Melo
2025-04-30  1:13     ` Arnaldo Carvalho de Melo
2025-04-30  1:22       ` Arnaldo Carvalho de Melo
2025-04-30  9:02         ` Ravi Bangoria
2025-04-30 13:06           ` Arnaldo Carvalho de Melo
2025-04-30 13:31             ` Arnaldo Carvalho de Melo
2025-04-30 16:07               ` Ravi Bangoria
2025-04-30 23:39                 ` Arnaldo Carvalho de Melo
2025-04-30  6:36       ` Ravi Bangoria
2025-04-30  6:33     ` Ravi Bangoria
2025-04-30  2:00 ` [PATCH v4 0/4] perf/amd/ibs: Add Zen5 support (tools changes) Arnaldo Carvalho de Melo
2025-05-13  8:32   ` Ravi Bangoria

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=573aeaa2-f99b-47fb-b9ac-1439f601e7e7@amd.com \
    --to=ravi.bangoria@amd.com \
    --cc=acme@kernel.org \
    --cc=ananth.narayan@amd.com \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=jmario@redhat.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=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=sandipan.das@amd.com \
    --cc=santosh.shukla@amd.com \
    /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).