Auto sync2gitlab import of libpfm-4.10.1-5.el8.src.rpm

This commit is contained in:
CentOS Sources 2022-06-17 17:17:02 +00:00
parent a788f96862
commit be821f0217
4 changed files with 5595 additions and 1 deletions

56
libpfm-amd_merge.patch Normal file
View File

@ -0,0 +1,56 @@
commit afa8700ce726153fa1547ce118f7f9b029e675c9
Author: Stephane Eranian <eranian@gmail.com>
Date: Wed Jan 16 13:23:11 2019 -0800
clarify description of AMD Fam17h MERGE event
This is a special event used when merging two counters together.
It needs to be programmed on the od-numbered performance counter.
Signed-off-by: Stephane Eranian <eranian@gmail.com>
diff --git a/lib/events/amd64_events_fam17h.h b/lib/events/amd64_events_fam17h.h
index 4f865b9..b0db898 100644
--- a/lib/events/amd64_events_fam17h.h
+++ b/lib/events/amd64_events_fam17h.h
@@ -954,7 +954,7 @@ static const amd64_entry_t amd64_fam17h_pe[]={
.umasks = amd64_fam17h_tablewalker_allocation,
},
{ .name = "MERGE",
- .desc = "See <xref file='svd_core_pmc' title='Large Increment per Cycle Events' format='name'>.",
+ .desc = "Merge two counters together. This event must be programmed on the odd performance counter",
.modmsk = AMD64_FAM17H_ATTRS,
.code = 0xfff,
.flags = 0,
commit ac95d1957771d527f7bf8d11a97fb10ee223d6c0
Author: Stephane Eranian <eranian@gmail.com>
Date: Thu Mar 14 15:19:13 2019 -0700
remove MERGE event from AMD Fam17h table
The MERGE event is not measuring an actual micro-architectural event. Instead
it is used to fuse two consecutive counters together to get a wider counter.
This should be used cautiously and is not currently compatible with Linux
perf_events interface and implementation.
Signed-off-by: Stephane Eranian <eranian@gmail.com>
diff --git a/lib/events/amd64_events_fam17h.h b/lib/events/amd64_events_fam17h.h
index b0db898..deadbed 100644
--- a/lib/events/amd64_events_fam17h.h
+++ b/lib/events/amd64_events_fam17h.h
@@ -953,13 +953,6 @@ static const amd64_entry_t amd64_fam17h_pe[]={
.numasks = LIBPFM_ARRAY_SIZE(amd64_fam17h_tablewalker_allocation),
.umasks = amd64_fam17h_tablewalker_allocation,
},
- { .name = "MERGE",
- .desc = "Merge two counters together. This event must be programmed on the odd performance counter",
- .modmsk = AMD64_FAM17H_ATTRS,
- .code = 0xfff,
- .flags = 0,
- .ngrp = 0,
- },
{ .name = "L1_BTB_CORRECTION",
.desc = "TBD",
.modmsk = AMD64_FAM17H_ATTRS,

184
libpfm-flags.patch Normal file
View File

@ -0,0 +1,184 @@
commit 20bd642e0ebc2c1d29e39417ee4665271df43d93
Author: Stephane Eranian <eranian@gmail.com>
Date: Thu Nov 7 10:47:02 2019 -0800
add support for speculation event information
This patch extends the information returned by get_event_info()
with speculation information. Some events can include occurrences
happening during speculative execution. This is important information
because it impacts the cost associated with such event. The
pfm_event_info_t struct is extended with a 2-bit field describing
whether or not the event counts during speculation.
Given that the speculation information is not always available from
hardware vendors, the field can have 3 values:
- PFM_EVENT_SPEC_INFO_NA: no information available (default)
- PFM_EVENT_INFO_SPEC_TRUE: event includes speculative execution
- PFM_EVENT_INFO_SPEC_FALSE: evnet does not include speculative execution
Signed-off-by: Stephane Eranian <eranian@gmail.com>
diff --git a/docs/man3/pfm_get_event_info.3 b/docs/man3/pfm_get_event_info.3
index 7eaa6cf..a8c7546 100644
--- a/docs/man3/pfm_get_event_info.3
+++ b/docs/man3/pfm_get_event_info.3
@@ -85,6 +85,16 @@ field means that at least one umask supports precise sampling. On Intel X86
processors, this indicates whether the event supports Precise Event-Based
Sampling (PEBS).
.PP
+.TP
+.B is_speculative
+This bitfield indicates whether or not the event includes occurrences happening
+during speculative execution for both wrong and correct path. Given that this
+kind of event information is not always available from vendors, this field uses
+multiple bits. A value of \fBPFM_EVENT_INFO_SPEC_NA\fR indicates that speculation
+information is not available. A value of \fBPFM_EVENT_INFO_SPEC_TRUE\fR indicates
+that the event count during speculative execution. A value of \fBPFM_EVENT_INFO_SPEC_FALS\fR
+indicates that the event does not count during speculative execution.
+.PP
The \fBpfm_os_t\fR enumeration provides the following choices:
.TP
diff --git a/examples/showevtinfo.c b/examples/showevtinfo.c
index 40966ac..44e958e 100644
--- a/examples/showevtinfo.c
+++ b/examples/showevtinfo.c
@@ -376,11 +376,16 @@ static void
print_event_flags(pfm_event_info_t *info)
{
int n = 0;
+ int spec = info->is_speculative;
if (info->is_precise) {
printf("[precise] ");
n++;
}
+ if (spec > PFM_EVENT_INFO_SPEC_NA) {
+ printf("[%s] ", spec == PFM_EVENT_INFO_SPEC_TRUE ? "speculative" : "non-speculative");
+ n++;
+ }
if (!n)
printf("None");
}
diff --git a/include/perfmon/pfmlib.h b/include/perfmon/pfmlib.h
index bd6f935..09c673d 100644
--- a/include/perfmon/pfmlib.h
+++ b/include/perfmon/pfmlib.h
@@ -645,6 +645,12 @@ typedef struct {
} SWIG_NAME(flags);
} pfm_pmu_info_t;
+typedef enum {
+ PFM_EVENT_INFO_SPEC_NA = 0,
+ PFM_EVENT_INFO_SPEC_TRUE = 1,
+ PFM_EVENT_INFO_SPEC_FALSE = 2,
+} pfm_event_info_spec_t;
+
typedef struct {
const char *name; /* event name */
const char *desc; /* event description */
@@ -657,8 +663,9 @@ typedef struct {
int nattrs; /* number of attributes */
int reserved; /* for future use */
struct {
- unsigned int is_precise:1; /* precise sampling (Intel X86=PEBS) */
- unsigned int reserved_bits:31;
+ unsigned int is_precise:1; /* precise sampling (Intel X86=PEBS) */
+ unsigned int is_speculative:2;/* count correct and wrong path occurrences */
+ unsigned int reserved_bits:29;
} SWIG_NAME(flags);
} pfm_event_info_t;
diff --git a/lib/pfmlib_common.c b/lib/pfmlib_common.c
index 688edb6..2b6cbb4 100644
--- a/lib/pfmlib_common.c
+++ b/lib/pfmlib_common.c
@@ -1951,7 +1951,8 @@ pfm_get_event_info(int idx, pfm_os_t os, pfm_event_info_t *uinfo)
info.dtype = PFM_DTYPE_UINT64;
/* reset flags */
- info.is_precise = 0;
+ info.is_precise = 0;
+ info.is_speculative = PFM_EVENT_INFO_SPEC_NA;
ret = pmu->get_event_info(pmu, pidx, &info);
if (ret != PFM_SUCCESS)
diff --git a/lib/pfmlib_priv.h b/lib/pfmlib_priv.h
index fe13351..b0070a6 100644
--- a/lib/pfmlib_priv.h
+++ b/lib/pfmlib_priv.h
@@ -186,6 +186,7 @@ typedef struct {
#define PFMLIB_PMU_FL_RAW_UMASK 0x4 /* PMU supports PFM_ATTR_RAW_UMASKS */
#define PFMLIB_PMU_FL_ARCH_DFL 0x8 /* PMU is arch default */
#define PFMLIB_PMU_FL_NO_SMPL 0x10 /* PMU does not support sampling */
+#define PFMLIB_PMU_FL_SPEC 0x20 /* PMU provides event speculation info */
typedef struct {
int initdone;
commit fb31170eab2d62d6cb182f14df3a6d8e065303d2
Author: Stephane Eranian <eranian@google.com>
Date: Thu Dec 19 16:13:16 2019 -0800
add PFMLIB_PMU_FL_DEPR flag
To mark a PMU model as deprecated. This is useful when a PMU model
is superseded by another one, yet the obsolete model must remain
for backward compatibility reason.
The ensures that a fully qualified event string with the old pmu
name will still be accepted. But when running on the matching
CPU model, the new PMU model will be selected by default when
the pmu model name is not specified.
Example: when running on pmu_old PMU model:
- pmu_old::cycles is still accepted
- pmu_new::cycles is accepted
- cycles is mapped to pmu_new::cycles
Signed-off-by: Stephane Eranian <eranian@gmail.com>
diff --git a/lib/pfmlib_common.c b/lib/pfmlib_common.c
index 8cb8998..31d16e9 100644
--- a/lib/pfmlib_common.c
+++ b/lib/pfmlib_common.c
@@ -712,6 +712,12 @@ pfmlib_pmu_active(pfmlib_pmu_t *pmu)
return !!(pmu->flags & PFMLIB_PMU_FL_ACTIVE);
}
+static inline int
+pfmlib_pmu_deprecated(pfmlib_pmu_t *pmu)
+{
+ return !!(pmu->flags & PFMLIB_PMU_FL_DEPR);
+}
+
static inline int
pfmlib_pmu_initialized(pfmlib_pmu_t *pmu)
{
@@ -1495,6 +1501,14 @@ pfmlib_parse_event(const char *event, pfmlib_event_desc_t *d)
*/
if (!pname && !pfmlib_pmu_active(pmu))
continue;
+
+ /*
+ * if the PMU name is not passed, then if
+ * the pmu is deprecated, then skip it. It means
+ * there is a better candidate in the active list
+ */
+ if (!pname && pfmlib_pmu_deprecated(pmu))
+ continue;
/*
* check for requested PMU name,
*/
diff --git a/lib/pfmlib_priv.h b/lib/pfmlib_priv.h
index 1340a6b..5cddc9c 100644
--- a/lib/pfmlib_priv.h
+++ b/lib/pfmlib_priv.h
@@ -187,6 +187,7 @@ typedef struct {
#define PFMLIB_PMU_FL_ARCH_DFL 0x8 /* PMU is arch default */
#define PFMLIB_PMU_FL_NO_SMPL 0x10 /* PMU does not support sampling */
#define PFMLIB_PMU_FL_SPEC 0x20 /* PMU provides event speculation info */
+#define PFMLIB_PMU_FL_DEPR 0x40 /* PMU model is deprecated */
typedef struct {
int initdone;

5345
libpfm-zen23.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,7 @@
Name: libpfm
Version: 4.10.1
Release: 4%{?dist}
Release: 5%{?dist}
Summary: Library to encode performance events for use by perf tool
@ -22,6 +22,9 @@ Patch2: libpfm-python3-setup.patch
Patch3: libpfm-zseries.patch
Patch4: libpfm-tx2.patch
Patch5: libpfm-a64fx.patch
Patch6: libpfm-flags.patch
Patch7: libpfm-amd_merge.patch
Patch8: libpfm-zen23.patch
%if %{with python}
BuildRequires: python3
@ -75,6 +78,9 @@ Python bindings for libpfm4 and perf_event_open system call.
%patch3 -p1 -b .zseries
%patch4 -p1 -b .tx2
%patch5 -p1 -b .a64fx
%patch6 -p1
%patch7 -p1
%patch8 -p1
%build
%if %{with python}
@ -123,6 +129,9 @@ make \
%endif
%changelog
* Sun May 8 2022 William Cohen <wcohen@redhat.com> - 4.10.1-5
- Add AMD Zen 2/3 support (RHBZ #2067218)
* Thu May 20 2021 William Cohen <wcohen@redhat.com> - 4.10.1-4
- Add Fujitsu A64FX support (RHBZ #1908126)