linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sandipan Das <sandipan.das@amd.com>
To: Ian Rogers <irogers@google.com>
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
	mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
	jolsa@kernel.org, namhyung@kernel.org, adrian.hunter@intel.com,
	ayush.jain3@amd.com, ananth.narayan@amd.com,
	ravi.bangoria@amd.com, santosh.shukla@amd.com
Subject: Re: [PATCH v2] perf vendor events amd: Fix large metrics
Date: Thu, 6 Jul 2023 19:52:09 +0530	[thread overview]
Message-ID: <ce15f15b-2f1d-960c-c20e-131d92e1d750@amd.com> (raw)
In-Reply-To: <CAP-5=fVdVSL4H1qWLZMiU3H2-bOJ0RkFOfq4Jxz1qw0-8EoYFw@mail.gmail.com>

Hi Ian,

On 7/6/2023 7:19 PM, Ian Rogers wrote:
> On Wed, Jul 5, 2023 at 11:34 PM Sandipan Das <sandipan.das@amd.com> wrote:
>>
>> There are cases where a metric requires more events than the number of
>> available counters. E.g. AMD Zen, Zen 2 and Zen 3 processors have four
>> data fabric counters but the "nps1_die_to_dram" metric has eight events.
>> By default, the constituent events are placed in a group and since the
>> events cannot be scheduled at the same time, the metric is not computed.
>> The "all metrics" test also fails because of this.
>>
>> Use the NO_GROUP_EVENTS constraint for such metrics which anyway expect
>> the user to run perf with "--metric-no-group".
>>
>> E.g.
>>
>>   $ sudo perf test -v 101
>>
>> Before:
>>
>>   101: perf all metrics test                                           :
>>   --- start ---
>>   test child forked, pid 37131
>>   Testing branch_misprediction_ratio
>>   Testing all_remote_links_outbound
>>   Testing nps1_die_to_dram
>>   Metric 'nps1_die_to_dram' not printed in:
>>   Error:
>>   Invalid event (dram_channel_data_controller_4) in per-thread mode, enable system wide with '-a'.
>>   Testing macro_ops_dispatched
>>   Testing all_l2_cache_accesses
>>   Testing all_l2_cache_hits
>>   Testing all_l2_cache_misses
>>   Testing ic_fetch_miss_ratio
>>   Testing l2_cache_accesses_from_l2_hwpf
>>   Testing l2_cache_misses_from_l2_hwpf
>>   Testing op_cache_fetch_miss_ratio
>>   Testing l3_read_miss_latency
>>   Testing l1_itlb_misses
>>   test child finished with -1
>>   ---- end ----
>>   perf all metrics test: FAILED!
>>
>> After:
>>
>>   101: perf all metrics test                                           :
>>   --- start ---
>>   test child forked, pid 43766
>>   Testing branch_misprediction_ratio
>>   Testing all_remote_links_outbound
>>   Testing nps1_die_to_dram
>>   Testing macro_ops_dispatched
>>   Testing all_l2_cache_accesses
>>   Testing all_l2_cache_hits
>>   Testing all_l2_cache_misses
>>   Testing ic_fetch_miss_ratio
>>   Testing l2_cache_accesses_from_l2_hwpf
>>   Testing l2_cache_misses_from_l2_hwpf
>>   Testing op_cache_fetch_miss_ratio
>>   Testing l3_read_miss_latency
>>   Testing l1_itlb_misses
>>   test child finished with 0
>>   ---- end ----
>>   perf all metrics test: Ok
>>
>> Reported-by: Ayush Jain <ayush.jain3@amd.com>
>> Suggested-by: Ian Rogers <irogers@google.com>
>> Signed-off-by: Sandipan Das <sandipan.das@amd.com>
> 
> Acked-by: Ian Rogers <irogers@google.com>
> 
> Will there be a PMU driver fix so that the perf_event_open fails for
> the group? That way the weak group would work.
> 

Yes, that's in our plan. Ravi (in CC) and I have discussed about adding
group validation in the event_init() path.

- Sandipan

  reply	other threads:[~2023-07-06 14:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-06  6:34 [PATCH v2] perf vendor events amd: Fix large metrics Sandipan Das
2023-07-06 13:49 ` Ian Rogers
2023-07-06 14:22   ` Sandipan Das [this message]
2023-07-11 14:51   ` Arnaldo Carvalho de Melo
2023-07-11 17:34     ` Namhyung Kim

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=ce15f15b-2f1d-960c-c20e-131d92e1d750@amd.com \
    --to=sandipan.das@amd.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=ananth.narayan@amd.com \
    --cc=ayush.jain3@amd.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.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 \
    --cc=ravi.bangoria@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).