From 2d1bc2eb4b02255cadc9e1b44a7c640113a04421 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Sat, 25 Jul 2009 06:25:23 +0000 Subject: [PATCH 01/94] - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 9e69939..6d54a64 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -1,7 +1,7 @@ Summary: A performance monitoring library for Linux Name: libpfm Version: 3.5 -Release: 3%{?dist} +Release: 4%{?dist} License: MIT Group: Development/Libraries ExclusiveArch: ia64 %{ix86} x86_64 ppc ppc64 @@ -71,6 +71,9 @@ rm -rf %{buildroot} %{_includedir}/* %changelog +* Fri Jul 24 2009 Fedora Release Engineering - 3.5-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + * Wed Feb 25 2009 Fedora Release Engineering - 3.5-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild From 96c665b0cb547b8daed94b7051ae7143d9102312 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Wed, 25 Nov 2009 23:51:13 +0000 Subject: [PATCH 02/94] Fix typo that causes a failure to update the common directory. (releng #2781) --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 387d56f..b80cfaa 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ # Makefile for source rpm: libpfm -# $Id: Makefile,v 1.1 2004/09/24 14:13:08 wcohen Exp $ +# $Id: Makefile,v 1.2 2007/10/15 19:03:58 notting Exp $ NAME := libpfm SPECFILE = $(firstword $(wildcard *.spec)) define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done endef MAKEFILE_COMMON := $(shell $(find-makefile-common)) From 1d75737b06ec8a2c2dc0480f29c1e235257c071c Mon Sep 17 00:00:00 2001 From: William Eden Cohen Date: Fri, 26 Feb 2010 20:47:57 +0000 Subject: [PATCH 03/94] Obsolete package --- .cvsignore | 1 - Makefile | 21 ----- dead.package | 2 + libpfm-3.2-rpm_opt.patch | 20 ---- libpfm-3.3-ia64-build.patch | 12 --- libpfm-3.4-unused.patch | 38 -------- libpfm.spec | 183 ------------------------------------ sources | 1 - 8 files changed, 2 insertions(+), 276 deletions(-) delete mode 100644 .cvsignore delete mode 100644 Makefile create mode 100644 dead.package delete mode 100644 libpfm-3.2-rpm_opt.patch delete mode 100644 libpfm-3.3-ia64-build.patch delete mode 100644 libpfm-3.4-unused.patch delete mode 100644 libpfm.spec delete mode 100644 sources diff --git a/.cvsignore b/.cvsignore deleted file mode 100644 index 40f853d..0000000 --- a/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -libpfm-3.5.tar.gz diff --git a/Makefile b/Makefile deleted file mode 100644 index b80cfaa..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: libpfm -# $Id: Makefile,v 1.2 2007/10/15 19:03:58 notting Exp $ -NAME := libpfm -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attempt a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/dead.package b/dead.package new file mode 100644 index 0000000..4c8548c --- /dev/null +++ b/dead.package @@ -0,0 +1,2 @@ +Obsolete package + diff --git a/libpfm-3.2-rpm_opt.patch b/libpfm-3.2-rpm_opt.patch deleted file mode 100644 index 8eae2f5..0000000 --- a/libpfm-3.2-rpm_opt.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- libpfm-3.2-060926/rules.mk.rpm_opt 2006-09-26 08:21:37.000000000 -0400 -+++ libpfm-3.2-060926/rules.mk 2006-10-01 21:33:10.000000000 -0400 -@@ -25,12 +25,12 @@ - .SUFFIXES: .c .S .o .lo .cpp - - .S.o: -- $(CC) $(CFLAGS) -c $*.S -+ $(CC) $(CFLAGS) $(RPM_OPT_FLAGS) -c $*.S - .c.o: -- $(CC) $(CFLAGS) -c $*.c -+ $(CC) $(CFLAGS) $(RPM_OPT_FLAGS) -c $*.c - .cpp.o: -- $(CXX) $(CFLAGS) -c $*.cpp -+ $(CXX) $(CFLAGS) $(RPM_OPT_FLAGS) -c $*.cpp - .c.lo: -- $(CC) -fPIC -DPIC $(CFLAGS) -c $*.c -o $*.lo -+ $(CC) -fPIC -DPIC $(CFLAGS) $(RPM_OPT_FLAGS) -c $*.c -o $*.lo - .S.lo: -- $(CC) -fPIC -DPIC $(CFLAGS) -c $*.S -o $*.lo -+ $(CC) -fPIC -DPIC $(CFLAGS) $(RPM_OPT_FLAGS) -c $*.S -o $*.lo diff --git a/libpfm-3.3-ia64-build.patch b/libpfm-3.3-ia64-build.patch deleted file mode 100644 index 9d6acf9..0000000 --- a/libpfm-3.3-ia64-build.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up libpfm-3.3/lib/pfmlib_itanium2.c.broken libpfm-3.3/lib/pfmlib_itanium2.c ---- libpfm-3.3/lib/pfmlib_itanium2.c.broken 2008-02-26 10:47:03.000000000 -0500 -+++ libpfm-3.3/lib/pfmlib_itanium2.c 2008-02-26 10:47:50.000000000 -0500 -@@ -231,7 +231,7 @@ check_inst_retired_events(pfmlib_input_p - int code; - int c; - unsigned int i, count, found = 0; -- unsigned long umask, mask; -+ unsigned long umask = 0, mask; - - pfm_get_event_code(PME_ITA2_IA64_INST_RETIRED_THIS, &code); - diff --git a/libpfm-3.4-unused.patch b/libpfm-3.4-unused.patch deleted file mode 100644 index 3bf1ae8..0000000 --- a/libpfm-3.4-unused.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff -up libpfm-3.5/examples/multiplex.c.unused libpfm-3.5/examples/multiplex.c ---- libpfm-3.5/examples/multiplex.c.unused 2008-07-31 16:58:21.000000000 -0400 -+++ libpfm-3.5/examples/multiplex.c 2008-07-31 16:59:18.000000000 -0400 -@@ -613,6 +613,7 @@ measure_one_cpu(char **argv) - struct pollfd pollfd; - pid_t pid = 0; - int ret, timeout; -+ int nbytes; - - memset(ctx, 0, sizeof(ctx)); - memset(&load_arg, 0, sizeof(load_arg)); -@@ -721,7 +722,7 @@ measure_one_cpu(char **argv) - */ - if (options.opt_ovfl_switch) { - pfarg_msg_t msg; -- read(ctxid, &msg, sizeof(msg)); -+ nbytes = read(ctxid, &msg, sizeof(msg)); - } - switch_sets(ctxid); - break; -diff -up libpfm-3.5/lib/pfmlib_os_linux.c.unused libpfm-3.5/lib/pfmlib_os_linux.c ---- libpfm-3.5/lib/pfmlib_os_linux.c.unused 2008-07-30 17:16:40.000000000 -0400 -+++ libpfm-3.5/lib/pfmlib_os_linux.c 2008-07-31 16:57:05.000000000 -0400 -@@ -390,12 +390,13 @@ static int - pfm_init_syscalls_sysfs(void) - { - FILE *fp; -+ int nbytes; - - fp = fopen("/sys/kernel/perfmon/syscall", "r"); - if (!fp) - return -1; - -- fscanf(fp, "%d", &sys_base); -+ nbytes = fscanf(fp, "%d", &sys_base); - - fclose(fp); - diff --git a/libpfm.spec b/libpfm.spec deleted file mode 100644 index 6d54a64..0000000 --- a/libpfm.spec +++ /dev/null @@ -1,183 +0,0 @@ -Summary: A performance monitoring library for Linux -Name: libpfm -Version: 3.5 -Release: 4%{?dist} -License: MIT -Group: Development/Libraries -ExclusiveArch: ia64 %{ix86} x86_64 ppc ppc64 -ExclusiveOS: linux -Source: http://prdownloads.sourceforge.net/perfmon2/%{name}-%{version}.tar.gz -URL: http://sourceforge.net/projects/perfmon2/ - -Patch3: libpfm-3.2-rpm_opt.patch -#Patch4: libpfm-3.2-man3.patch -Patch5: libpfm-3.3-ia64-build.patch -Patch6: libpfm-3.4-unused.patch - -BuildRequires: ncurses-devel -BuildRoot: %{_tmppath}/%{name}-%{version}-root - -%description -This package contains a library to develop performance monitoring -applications using the Performance Monitor Unit (PMU) available on -various processors. - -%package devel -Summary: the Linux performance library (libpfm) development files. -Group: Development/Libraries -Requires: %{name} = %{version}-%{release} - -%description devel -The performance monitoring library (libpfm) is used to develop -performance monitoring applications using the Performance Monitoring -Unit (PMU) available on various processors. This package provides the -files necessary for development of applications. -It requires a kernel perfmon-2.x subsystem. - -Requires: ncurses - -%prep -%setup -q -n %{name}-%{version} -%patch3 -p1 -b .rpm_opt -#%patch4 -p1 -b .man3 -%patch5 -p1 -b .ia64build -%patch6 -p1 -b .unused - -%build -make PREFIX=/usr DESTDIR=%{buildroot} LIBDIR=%{_libdir} - -%install -rm -rf %{buildroot} -mkdir -p %{buildroot} -make install PREFIX=/usr DESTDIR=%{buildroot} LIBDIR=%{_libdir} -# If we need this static library, make a -static subpackage for it. -rm -rf %{buildroot}/%{_libdir}/*.a - -%post -p /sbin/ldconfig -%postun -p /sbin/ldconfig - -%clean -rm -rf %{buildroot} - -%files -%defattr(-,root,root,-) -%doc README COPYRIGHT -%attr(755,root,root) %{_libdir}/*.so.* - -%files devel -%defattr(-,root,root,-) -%{_mandir}/man3/* -%{_libdir}/libpfm.so -%{_includedir}/* - -%changelog -* Fri Jul 24 2009 Fedora Release Engineering - 3.5-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild - -* Wed Feb 25 2009 Fedora Release Engineering - 3.5-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild - -* Thu Aug 7 2008 Tom "spot" Callaway - 3.5-2 -- fix license tag -- package cleanups (drop static library, package shared bits correctly) - -* Thu Jul 31 2008 Will Cohen - 3.5-1 -- Update to libpfm-3.5. - -* Fri May 2 2008 Will Cohen - 3.4-1 -- Update to libpfm-3.4. - -* Tue Feb 26 2008 Will Cohen - 3.3-0.080225.2 -- Correct possibly unitialized variable umask. Resolves: rhbz #434968 - -* Mon Feb 25 2008 Will Cohen - 3.3-0.080225.1 -- Update to libpfm-3.3. - -* Wed Feb 20 2008 Fedora Release Engineering - 3.2-1.071017.1 -- Autorebuild for GCC 4.3 - -* Wed Oct 24 2007 Will Cohen - 3.2-0.071017.1 -- Update to libpfm-3.2-071017. - -* Tue Aug 21 2007 Will Cohen - 3.2-0.061205.3 -- rebuild - -* Mon May 21 2007 Will Cohen - 3.2-0.061205.2 -- Fix up rpmlint complaints. - -* Mon Dec 4 2006 Will Cohen - 3.2-0.061205.1 -- Update to libpfm-3.2-061205. - -* Fri Nov 3 2006 Will Cohen - 3.2-0.060926.3 -- Add dist tag to build. - -* Sun Oct 1 2006 Will Cohen - 3.2-0.060926.2 -- Eliminate unneeded libpfm-compa.tpatch. - -* Sun Oct 1 2006 Will Cohen - 3.2-0.060926.1 -- Update to libpfm-3.2-060926. - -* Tue Sep 19 2006 Will Cohen - 3.2-0.060621.10 -- Make sure fix works on i386. (#205221) - -* Tue Sep 19 2006 Will Cohen - 3.2-0.060621.9 -- Make sure libraries put in correct directory. (#205221) - -* Wed Jul 12 2006 Jesse Keating - 3.2-0.060621.8.1 -- rebuild - -* Sat Jul 8 2006 Will Cohen -- Avoid pulling in the example ELF executable into /usr/share. (#198001) -- Mark man pages as documentation. - -* Tue Jun 27 2006 Will Cohen -- Add ncurses requires. -- Add ncurses-devel buildprereq. - -* Mon Jun 26 2006 Will Cohen -- Make sure that CFLAGS in pfmlib/lib/ is used. -- Separate build and install processes. -- Clean up the descriptions. - -* Mon Jun 26 2006 Will Cohen -- Update to libpfm-3.2-060621. - -* Wed Jun 14 2006 Will Cohen -- Update to libpfm-3.2-060613. - -* Fri May 05 2006 Will Cohen -- fno-strict-aliasing so ia64 builds. - -* Fri May 05 2006 Will Cohen -- make sure that perfmon_compat.h installed for ia64. - -* Thu May 04 2006 Will Cohen -- Update to libpfm-3.2-060421. - -* Thu Feb 09 2006 Florian La Roche -- remove empty scripts - -* Tue Feb 07 2006 Jesse Keating - 3.0-4.2 -- rebuilt for new gcc4.1 snapshot and glibc changes - -* Fri Dec 09 2005 Jesse Keating -- rebuilt - -* Mon Mar 14 2005 Will Cohen -- Bump rebuild with gcc4. - -* Tue Oct 26 2004 Will Cohen -- Correct ownership of files. - -* Mon Sep 27 2004 Will Cohen -- Correct spec file for build system. - -* Mon Dec 1 2003 Stephane Eranian -- release 3.0 final version -* Thu Jan 02 2003 Stephane Eranian -- release final 2.0 version -* Fri Dec 20 2002 Stephane Eranian -- final 2.0 release -* Thu Dec 05 2002 Stephane Eranian -- initial release of the library as a standalone package -- see ChangeLog for actual log diff --git a/sources b/sources deleted file mode 100644 index 4992fd7..0000000 --- a/sources +++ /dev/null @@ -1 +0,0 @@ -01caa64e409d378bd420aca9d3bc6efb libpfm-3.5.tar.gz From 9ae3bad4535699f6ba5e0982c63d0858a99e7f02 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Fri, 8 Jun 2012 10:00:34 -0400 Subject: [PATCH 04/94] Revive libpfm and import (#804666). --- .gitignore | 1 + dead.package | 2 - libpfm-siginfo_t.patch | 24 ++++++++ libpfm.spec | 132 +++++++++++++++++++++++++++++++++++++++++ libpfm4-python.patch | 35 +++++++++++ sources | 1 + 6 files changed, 193 insertions(+), 2 deletions(-) create mode 100644 .gitignore delete mode 100644 dead.package create mode 100644 libpfm-siginfo_t.patch create mode 100644 libpfm.spec create mode 100644 libpfm4-python.patch create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3a28af5 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/libpfm-4.2.0.tar.gz diff --git a/dead.package b/dead.package deleted file mode 100644 index 4c8548c..0000000 --- a/dead.package +++ /dev/null @@ -1,2 +0,0 @@ -Obsolete package - diff --git a/libpfm-siginfo_t.patch b/libpfm-siginfo_t.patch new file mode 100644 index 0000000..06f4561 --- /dev/null +++ b/libpfm-siginfo_t.patch @@ -0,0 +1,24 @@ +diff -up libpfm-4.2.0/perf_examples/notify_group.c.siginfo_t libpfm-4.2.0/perf_examples/notify_group.c +--- libpfm-4.2.0/perf_examples/notify_group.c.siginfo_t 2012-06-07 14:48:30.969999948 -0400 ++++ libpfm-4.2.0/perf_examples/notify_group.c 2012-06-07 14:49:13.124000197 -0400 +@@ -51,7 +51,7 @@ static int num_fds; + static int buffer_pages = 1; /* size of buffer payload (must be power of 2) */ + + static void +-sigio_handler(int n, struct siginfo *info, struct sigcontext *sc) ++sigio_handler(int n, siginfo_t *info, struct sigcontext *sc) + { + struct perf_event_mmap_page *hdr; + struct perf_event_header ehdr; +diff -up libpfm-4.2.0/perf_examples/notify_self.c.siginfo_t libpfm-4.2.0/perf_examples/notify_self.c +--- libpfm-4.2.0/perf_examples/notify_self.c.siginfo_t 2012-06-07 14:48:39.559998906 -0400 ++++ libpfm-4.2.0/perf_examples/notify_self.c 2012-06-07 14:49:02.143000006 -0400 +@@ -47,7 +47,7 @@ static int num_fds = 0; + static int buffer_pages = 1; /* size of buffer payload (must be power of 2)*/ + + static void +-sigio_handler(int n, struct siginfo *info, void *uc) ++sigio_handler(int n, siginfo_t *info, void *uc) + { + struct perf_event_header ehdr; + int ret, id; diff --git a/libpfm.spec b/libpfm.spec new file mode 100644 index 0000000..6eb0999 --- /dev/null +++ b/libpfm.spec @@ -0,0 +1,132 @@ +%bcond_without python +%if %{with python} +%define python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)") +%define python_prefix %(python -c "import sys; print sys.prefix") +%{?filter_setup: +%filter_provides_in %{python_sitearch}/perfmon/.*\.so$ +%filter_setup +} +%endif + +Name: libpfm +Version: 4.2.0 +Release: 6%{?dist} + +Summary: Library to encode performance events for use by perf tool + +Group: System Environment/Libraries +License: MIT +URL: http://perfmon2.sourceforge.net/ +Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz +Patch1: libpfm4-python.patch +Patch2: libpfm-siginfo_t.patch + +%if %{with python} +BuildRequires: python-devel +BuildRequires: python-setuptools-devel +BuildRequires: swig +%endif + +%description + +libpfm4 is a library to help encode events for use with operating system +kernels performance monitoring interfaces. The current version provides support +for the perf_events interface available in upstream Linux kernels since v2.6.31. + +%package devel +Summary: Development library to encode performance events for perf_events based tools +Group: Development/Libraries +Requires: %{name}%{?_isa} = %{version} + +%description devel +Development library and header files to create performance monitoring +applications for the perf_events interface. + +%package static +Summary: Static library to encode performance events for perf_events based tools +Group: Development/Libraries +Requires: %{name}%{?_isa} = %{version} + +%description static +Static version of the libpfm library for performance monitoring +applications for the perf_events interface. + +%if %{with python} +%package python +Summary: Python bindings for libpfm and perf_event_open system call +Group: Development/Languages +Requires: %{name}%{?_isa} = %{version} + +%description python +Python bindings for libpfm4 and perf_event_open system call. +%endif + +%prep +%setup -q + +%patch1 -p1 +%patch2 -p1 + +%build +%if %{with python} +%global python_config CONFIG_PFMLIB_NOPYTHON=n +%else +%global python_config CONFIG_PFMLIB_NOPYTHON=y +%endif +make %{python_config} %{?_smp_mflags} + + +%install +rm -rf $RPM_BUILD_ROOT + +%if %{with python} +%global python_config CONFIG_PFMLIB_NOPYTHON=n PYTHON_PREFIX=$RPM_BUILD_ROOT/%{python_prefix} +%else +%global python_config CONFIG_PFMLIB_NOPYTHON=y +%endif + +make \ + PREFIX=$RPM_BUILD_ROOT%{_prefix} \ + LIBDIR=$RPM_BUILD_ROOT%{_libdir} \ + %{python_config} \ + install + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%files +%doc README +%{_libdir}/lib*.so.* + +%files devel +%{_includedir}/* +%{_mandir}/man3/* +%{_libdir}/lib*.so + +%files static +%{_libdir}/lib*.a + +%if %{with python} +%files python +%{python_sitearch}/* +%endif + +%changelog +* Thu Jun 7 2012 William Cohen 4.2.0-6 +- Eliminate rpm_build_root macro in build section. +- Correct location of shared library files. + +* Thu Jun 7 2012 William Cohen 4.2.0-5 +- Use siginfo_t for some examples. + +* Mon Jun 4 2012 William Cohen 4.2.0-4 +- Correct python files. + +* Wed Mar 28 2012 William Cohen 4.2.0-3 +- Additional spec file fixup for rhbz804666. + +* Wed Mar 14 2012 William Cohen 4.2.0-2 +- Some spec file fixup. + +* Wed Jan 12 2011 Arun Sharma 4.2.0-0 +Initial revision diff --git a/libpfm4-python.patch b/libpfm4-python.patch new file mode 100644 index 0000000..6f0e907 --- /dev/null +++ b/libpfm4-python.patch @@ -0,0 +1,35 @@ +From fe0b30189334f048db0cab10987b9e2295c5b93c Mon Sep 17 00:00:00 2001 +From: Arun Sharma +Date: Thu, 26 Apr 2012 17:37:02 +0200 +Subject: [PATCH] drop shbang from python scripts + +do not make then executable by dropping the +!/usr/bin/env python invocation. + +Signed-off-by: Arun Sharma +--- + python/src/pmu.py | 1 - + python/src/session.py | 1 - + 2 files changed, 0 insertions(+), 2 deletions(-) + +diff --git a/python/src/pmu.py b/python/src/pmu.py +index e90b72a..47c3e75 100644 +--- a/python/src/pmu.py ++++ b/python/src/pmu.py +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + # + # Copyright (c) 2008 Google, Inc. + # Contributed by Arun Sharma +diff --git a/python/src/session.py b/python/src/session.py +index df22ea6..f598aa4 100644 +--- a/python/src/session.py ++++ b/python/src/session.py +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + # + # Copyright (c) 2008 Google, Inc. + # Contributed by Arun Sharma +-- +1.7.4.1 + diff --git a/sources b/sources new file mode 100644 index 0000000..30a9666 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +09e298572ee810cc6319494f3fd5979c libpfm-4.2.0.tar.gz From 1bd5d57e0dde81ee4dd97b311028b716f78fd11e Mon Sep 17 00:00:00 2001 From: William Cohen Date: Fri, 8 Jun 2012 13:55:16 -0400 Subject: [PATCH 05/94] Avoid triggering swig segfault When building with swig 2.0.7 in rawhide the the printing of a warning message in swig would cause swig to segfault. This patch avoids the error message and allow libpfm to build. --- libpfm-swig.patch | 11 +++++++++++ libpfm.spec | 7 ++++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 libpfm-swig.patch diff --git a/libpfm-swig.patch b/libpfm-swig.patch new file mode 100644 index 0000000..12d31d8 --- /dev/null +++ b/libpfm-swig.patch @@ -0,0 +1,11 @@ +diff -up libpfm-4.2.0/python/src/perfmon_int.i.ill libpfm-4.2.0/python/src/perfmon_int.i +--- libpfm-4.2.0/python/src/perfmon_int.i.ill 2012-06-08 12:39:16.872998571 -0400 ++++ libpfm-4.2.0/python/src/perfmon_int.i 2012-06-08 12:39:30.183000006 -0400 +@@ -92,7 +92,6 @@ ptr_argout(pfm_event_attr_info_t); + + /* Kernel interface */ + %include +-ptr_argout(perf_event_attr_t); + + /* Library interface */ + /* We never set the const char * members. So no memory leak */ diff --git a/libpfm.spec b/libpfm.spec index 6eb0999..ec7272b 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.2.0 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Library to encode performance events for use by perf tool @@ -20,6 +20,7 @@ URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz Patch1: libpfm4-python.patch Patch2: libpfm-siginfo_t.patch +Patch3: libpfm-swig.patch %if %{with python} BuildRequires: python-devel @@ -66,6 +67,7 @@ Python bindings for libpfm4 and perf_event_open system call. %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build %if %{with python} @@ -112,6 +114,9 @@ make \ %endif %changelog +* Fri Jun 8 2012 William Cohen 4.2.0-7 +- Eliminate swig error. + * Thu Jun 7 2012 William Cohen 4.2.0-6 - Eliminate rpm_build_root macro in build section. - Correct location of shared library files. From ec48aaa1682d0c916a228c65630fd2c19b88c56c Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 19 Jul 2012 15:52:03 -0500 Subject: [PATCH 06/94] - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index ec7272b..d441032 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.2.0 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Library to encode performance events for use by perf tool @@ -114,6 +114,9 @@ make \ %endif %changelog +* Thu Jul 19 2012 Fedora Release Engineering - 4.2.0-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + * Fri Jun 8 2012 William Cohen 4.2.0-7 - Eliminate swig error. From 95ba25063d12b62bb6bd804f5f2840c9f3d6852d Mon Sep 17 00:00:00 2001 From: William Cohen Date: Tue, 28 Aug 2012 10:09:57 -0400 Subject: [PATCH 07/94] Rebase to libpfm-4.3.0. --- .gitignore | 2 +- libpfm-ldconf.patch | 11 +++++++++++ libpfm-siginfo_t.patch | 24 ------------------------ libpfm-swig.patch | 11 ----------- libpfm.spec | 15 +++++++-------- libpfm4-python.patch | 35 ----------------------------------- sources | 2 +- 7 files changed, 20 insertions(+), 80 deletions(-) create mode 100644 libpfm-ldconf.patch delete mode 100644 libpfm-siginfo_t.patch delete mode 100644 libpfm-swig.patch delete mode 100644 libpfm4-python.patch diff --git a/.gitignore b/.gitignore index 3a28af5..65250a7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/libpfm-4.2.0.tar.gz +/libpfm-4.3.0.tar.gz diff --git a/libpfm-ldconf.patch b/libpfm-ldconf.patch new file mode 100644 index 0000000..3fb4aea --- /dev/null +++ b/libpfm-ldconf.patch @@ -0,0 +1,11 @@ +diff -up libpfm-4.2.0/lib/Makefile.orig libpfm-4.2.0/lib/Makefile +--- libpfm-4.2.0/lib/Makefile.orig 2012-08-27 14:22:31.855449622 -0400 ++++ libpfm-4.2.0/lib/Makefile 2012-08-27 14:23:01.783526784 -0400 +@@ -244,7 +244,6 @@ ifeq ($(CONFIG_PFMLIB_SHARED),y) + $(INSTALL) $(SLIBPFM) $(DESTDIR)$(LIBDIR) + cd $(DESTDIR)$(LIBDIR); $(LN) $(SLIBPFM) $(VLIBPFM) + cd $(DESTDIR)$(LIBDIR); $(LN) $(SLIBPFM) libpfm.$(SOLIBEXT) +- $(LDCONFIG) + endif + + tags: diff --git a/libpfm-siginfo_t.patch b/libpfm-siginfo_t.patch deleted file mode 100644 index 06f4561..0000000 --- a/libpfm-siginfo_t.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -up libpfm-4.2.0/perf_examples/notify_group.c.siginfo_t libpfm-4.2.0/perf_examples/notify_group.c ---- libpfm-4.2.0/perf_examples/notify_group.c.siginfo_t 2012-06-07 14:48:30.969999948 -0400 -+++ libpfm-4.2.0/perf_examples/notify_group.c 2012-06-07 14:49:13.124000197 -0400 -@@ -51,7 +51,7 @@ static int num_fds; - static int buffer_pages = 1; /* size of buffer payload (must be power of 2) */ - - static void --sigio_handler(int n, struct siginfo *info, struct sigcontext *sc) -+sigio_handler(int n, siginfo_t *info, struct sigcontext *sc) - { - struct perf_event_mmap_page *hdr; - struct perf_event_header ehdr; -diff -up libpfm-4.2.0/perf_examples/notify_self.c.siginfo_t libpfm-4.2.0/perf_examples/notify_self.c ---- libpfm-4.2.0/perf_examples/notify_self.c.siginfo_t 2012-06-07 14:48:39.559998906 -0400 -+++ libpfm-4.2.0/perf_examples/notify_self.c 2012-06-07 14:49:02.143000006 -0400 -@@ -47,7 +47,7 @@ static int num_fds = 0; - static int buffer_pages = 1; /* size of buffer payload (must be power of 2)*/ - - static void --sigio_handler(int n, struct siginfo *info, void *uc) -+sigio_handler(int n, siginfo_t *info, void *uc) - { - struct perf_event_header ehdr; - int ret, id; diff --git a/libpfm-swig.patch b/libpfm-swig.patch deleted file mode 100644 index 12d31d8..0000000 --- a/libpfm-swig.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up libpfm-4.2.0/python/src/perfmon_int.i.ill libpfm-4.2.0/python/src/perfmon_int.i ---- libpfm-4.2.0/python/src/perfmon_int.i.ill 2012-06-08 12:39:16.872998571 -0400 -+++ libpfm-4.2.0/python/src/perfmon_int.i 2012-06-08 12:39:30.183000006 -0400 -@@ -92,7 +92,6 @@ ptr_argout(pfm_event_attr_info_t); - - /* Kernel interface */ - %include --ptr_argout(perf_event_attr_t); - - /* Library interface */ - /* We never set the const char * members. So no memory leak */ diff --git a/libpfm.spec b/libpfm.spec index d441032..3749ce3 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,8 +9,8 @@ %endif Name: libpfm -Version: 4.2.0 -Release: 8%{?dist} +Version: 4.3.0 +Release: 1%{?dist} Summary: Library to encode performance events for use by perf tool @@ -18,9 +18,7 @@ Group: System Environment/Libraries License: MIT URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz -Patch1: libpfm4-python.patch -Patch2: libpfm-siginfo_t.patch -Patch3: libpfm-swig.patch +Patch4: libpfm-ldconf.patch %if %{with python} BuildRequires: python-devel @@ -65,9 +63,7 @@ Python bindings for libpfm4 and perf_event_open system call. %prep %setup -q -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 +%patch4 -p1 %build %if %{with python} @@ -114,6 +110,9 @@ make \ %endif %changelog +* Tue Aug 28 2012 William Cohen 4.3.0-1 +- Rebase on libpfm-4.3.0. + * Thu Jul 19 2012 Fedora Release Engineering - 4.2.0-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild diff --git a/libpfm4-python.patch b/libpfm4-python.patch deleted file mode 100644 index 6f0e907..0000000 --- a/libpfm4-python.patch +++ /dev/null @@ -1,35 +0,0 @@ -From fe0b30189334f048db0cab10987b9e2295c5b93c Mon Sep 17 00:00:00 2001 -From: Arun Sharma -Date: Thu, 26 Apr 2012 17:37:02 +0200 -Subject: [PATCH] drop shbang from python scripts - -do not make then executable by dropping the -!/usr/bin/env python invocation. - -Signed-off-by: Arun Sharma ---- - python/src/pmu.py | 1 - - python/src/session.py | 1 - - 2 files changed, 0 insertions(+), 2 deletions(-) - -diff --git a/python/src/pmu.py b/python/src/pmu.py -index e90b72a..47c3e75 100644 ---- a/python/src/pmu.py -+++ b/python/src/pmu.py -@@ -1,4 +1,3 @@ --#!/usr/bin/env python - # - # Copyright (c) 2008 Google, Inc. - # Contributed by Arun Sharma -diff --git a/python/src/session.py b/python/src/session.py -index df22ea6..f598aa4 100644 ---- a/python/src/session.py -+++ b/python/src/session.py -@@ -1,4 +1,3 @@ --#!/usr/bin/env python - # - # Copyright (c) 2008 Google, Inc. - # Contributed by Arun Sharma --- -1.7.4.1 - diff --git a/sources b/sources index 30a9666..b15d7c1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -09e298572ee810cc6319494f3fd5979c libpfm-4.2.0.tar.gz +0ab272dbdbb759b852ba8bd06db030ef libpfm-4.3.0.tar.gz From a90bf62439554b9182a24aa61312b36f2e12f0a2 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Tue, 28 Aug 2012 14:56:14 -0400 Subject: [PATCH 08/94] Turn off LDCONFIG and remove patch. --- libpfm-ldconf.patch | 11 ----------- libpfm.spec | 9 +++++---- 2 files changed, 5 insertions(+), 15 deletions(-) delete mode 100644 libpfm-ldconf.patch diff --git a/libpfm-ldconf.patch b/libpfm-ldconf.patch deleted file mode 100644 index 3fb4aea..0000000 --- a/libpfm-ldconf.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up libpfm-4.2.0/lib/Makefile.orig libpfm-4.2.0/lib/Makefile ---- libpfm-4.2.0/lib/Makefile.orig 2012-08-27 14:22:31.855449622 -0400 -+++ libpfm-4.2.0/lib/Makefile 2012-08-27 14:23:01.783526784 -0400 -@@ -244,7 +244,6 @@ ifeq ($(CONFIG_PFMLIB_SHARED),y) - $(INSTALL) $(SLIBPFM) $(DESTDIR)$(LIBDIR) - cd $(DESTDIR)$(LIBDIR); $(LN) $(SLIBPFM) $(VLIBPFM) - cd $(DESTDIR)$(LIBDIR); $(LN) $(SLIBPFM) libpfm.$(SOLIBEXT) -- $(LDCONFIG) - endif - - tags: diff --git a/libpfm.spec b/libpfm.spec index 3749ce3..ec1fd01 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.3.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library to encode performance events for use by perf tool @@ -18,7 +18,6 @@ Group: System Environment/Libraries License: MIT URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz -Patch4: libpfm-ldconf.patch %if %{with python} BuildRequires: python-devel @@ -63,8 +62,6 @@ Python bindings for libpfm4 and perf_event_open system call. %prep %setup -q -%patch4 -p1 - %build %if %{with python} %global python_config CONFIG_PFMLIB_NOPYTHON=n @@ -87,6 +84,7 @@ make \ PREFIX=$RPM_BUILD_ROOT%{_prefix} \ LIBDIR=$RPM_BUILD_ROOT%{_libdir} \ %{python_config} \ + LDCONFIG=/bin/true \ install %post -p /sbin/ldconfig @@ -110,6 +108,9 @@ make \ %endif %changelog +* Tue Aug 28 2012 William Cohen 4.3.0-2 +- Turn off LDCONFIG and remove patch. + * Tue Aug 28 2012 William Cohen 4.3.0-1 - Rebase on libpfm-4.3.0. From 95117c1e63fd254237dc56a1a706ce5dcb1ddf52 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 13 Feb 2013 23:03:51 -0600 Subject: [PATCH 09/94] - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index ec1fd01..e61fb70 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.3.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Library to encode performance events for use by perf tool @@ -108,6 +108,9 @@ make \ %endif %changelog +* Thu Feb 14 2013 Fedora Release Engineering - 4.3.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + * Tue Aug 28 2012 William Cohen 4.3.0-2 - Turn off LDCONFIG and remove patch. From 00467d5ab2a08d989431a4d5c044d90c2207f46e Mon Sep 17 00:00:00 2001 From: William Cohen Date: Mon, 17 Jun 2013 15:12:58 -0400 Subject: [PATCH 10/94] Rebase on libpfm-4.4.0 --- .gitignore | 1 + libpfm.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 65250a7..2347953 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /libpfm-4.3.0.tar.gz +/libpfm-4.4.0.tar.gz diff --git a/libpfm.spec b/libpfm.spec index e61fb70..3dcf38f 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,8 +9,8 @@ %endif Name: libpfm -Version: 4.3.0 -Release: 3%{?dist} +Version: 4.4.0 +Release: 1%{?dist} Summary: Library to encode performance events for use by perf tool @@ -108,6 +108,9 @@ make \ %endif %changelog +* Mon Jun 17 2013 William Cohen 4.4.0-1 +- Rebase on libpfm-4.4.0. + * Thu Feb 14 2013 Fedora Release Engineering - 4.3.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild diff --git a/sources b/sources index b15d7c1..6be9ae5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -0ab272dbdbb759b852ba8bd06db030ef libpfm-4.3.0.tar.gz +93b853c97a41044ef33c3071bdedb249 libpfm-4.4.0.tar.gz From 71fa8e87bea5f73027fa7d81c2de2b9882023e01 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Fri, 19 Jul 2013 18:52:06 -0400 Subject: [PATCH 11/94] related: rhbz830275 - Add support for POWER8 processor to PAPI --- libpfm-power8.patch | 1171 +++++++++++++++++++++++++++++++++++++++++++ libpfm.spec | 8 +- 2 files changed, 1178 insertions(+), 1 deletion(-) create mode 100644 libpfm-power8.patch diff --git a/libpfm-power8.patch b/libpfm-power8.patch new file mode 100644 index 0000000..1177a5b --- /dev/null +++ b/libpfm-power8.patch @@ -0,0 +1,1171 @@ +commit a637b532a405aa3c8c210f21f925e87c11bbeb3f +Author: Carl Love +Date: Mon Jun 17 22:11:44 2013 +0200 + + Add IBM Power 8 support + + This patch adds support for the Power 8 CPU events to the + libpfm4 library. + + Signed-off-by: Carl Love + +diff --git a/README b/README +index 74cc89f..905b768 100644 +--- a/README ++++ b/README +@@ -67,6 +67,7 @@ The library supports many PMUs. The current version can handle: + Power 5 + Power 6 + Power 7 ++ Power 8 + PPC970 + Torrent + System z (s390x) +diff --git a/include/perfmon/pfmlib.h b/include/perfmon/pfmlib.h +index 709048c..89b9fd8 100644 +--- a/include/perfmon/pfmlib.h ++++ b/include/perfmon/pfmlib.h +@@ -190,6 +190,8 @@ typedef enum { + PFM_PMU_INTEL_IVB_UNC_CB2, /* Intel IvyBridge C-box 2 uncore PMU */ + PFM_PMU_INTEL_IVB_UNC_CB3, /* Intel IvyBridge C-box 3 uncore PMU */ + ++ PFM_PMU_POWER8, /* IBM POWER8 */ ++ + /* MUST ADD NEW PMU MODELS HERE */ + + PFM_PMU_MAX /* end marker */ +diff --git a/lib/Makefile b/lib/Makefile +index a103927..98411b8 100644 +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -95,7 +95,7 @@ SRCS += pfmlib_powerpc_perf_event.c + endif + + INCARCH = $(INC_POWERPC) +-SRCS += pfmlib_powerpc.c pfmlib_power4.c pfmlib_ppc970.c pfmlib_power5.c pfmlib_power6.c pfmlib_power7.c pfmlib_torrent.c ++SRCS += pfmlib_powerpc.c pfmlib_power4.c pfmlib_ppc970.c pfmlib_power5.c pfmlib_power6.c pfmlib_power7.c pfmlib_torrent.c pfmlib_power8.c + CFLAGS += -DCONFIG_PFMLIB_ARCH_POWERPC + endif + +@@ -227,6 +227,7 @@ INC_POWERPC=events/ppc970_events.h \ + events/power5+_events.h \ + events/power6_events.h \ + events/power7_events.h \ ++ events/power8_events.h \ + events/torrent_events.h + + INC_S390X=pfmlib_s390x_priv.h \ +diff --git a/lib/events/power8_events.h b/lib/events/power8_events.h +new file mode 100644 +index 0000000..25945f3 +--- /dev/null ++++ b/lib/events/power8_events.h +@@ -0,0 +1,1009 @@ ++/****************************/ ++/* THIS IS OPEN SOURCE CODE */ ++/****************************/ ++ ++#ifndef __POWER8_EVENTS_H__ ++#define __POWER8_EVENTS_H__ ++ ++/* ++* File: power8_events.h ++* CVS: ++Author: Carl Love ++* carll.ibm.com ++* Mods: ++* ++* ++* (C) Copyright IBM Corporation, 2013. All Rights Reserved. ++* Contributed by ++* ++* Note: This code was automatically generated and should not be modified by ++* hand. ++* ++* Documentation on the PMU events will be published at: ++* http://www.power.org/documentation ++*/ ++ ++#define POWER8_PME_PM_1PLUS_PPC_CMPL 0 ++#define POWER8_PME_PM_1PLUS_PPC_DISP 1 ++#define POWER8_PME_PM_ANY_THRD_RUN_CYC 2 ++#define POWER8_PME_PM_BR_MPRED_CMPL 3 ++#define POWER8_PME_PM_BR_TAKEN_CMPL 4 ++#define POWER8_PME_PM_CYC 5 ++#define POWER8_PME_PM_DATA_FROM_L2MISS 6 ++#define POWER8_PME_PM_DATA_FROM_L3MISS 7 ++#define POWER8_PME_PM_DATA_FROM_MEM 8 ++#define POWER8_PME_PM_DTLB_MISS 9 ++#define POWER8_PME_PM_EXT_INT 10 ++#define POWER8_PME_PM_FLOP 11 ++#define POWER8_PME_PM_FLUSH 12 ++#define POWER8_PME_PM_GCT_NOSLOT_CYC 13 ++#define POWER8_PME_PM_IERAT_MISS 14 ++#define POWER8_PME_PM_INST_DISP 15 ++#define POWER8_PME_PM_INST_FROM_L3MISS 16 ++#define POWER8_PME_PM_ITLB_MISS 17 ++#define POWER8_PME_PM_L1_DCACHE_RELOAD_VALID 18 ++#define POWER8_PME_PM_L1_ICACHE_MISS 19 ++#define POWER8_PME_PM_LD_MISS_L1 20 ++#define POWER8_PME_PM_LSU_DERAT_MISS 21 ++#define POWER8_PME_PM_MRK_BR_MPRED_CMPL 22 ++#define POWER8_PME_PM_MRK_BR_TAKEN_CMPL 23 ++#define POWER8_PME_PM_MRK_DATA_FROM_L2MISS 24 ++#define POWER8_PME_PM_MRK_DATA_FROM_L3MISS 25 ++#define POWER8_PME_PM_MRK_DATA_FROM_MEM 26 ++#define POWER8_PME_PM_MRK_DERAT_MISS 27 ++#define POWER8_PME_PM_MRK_DTLB_MISS 28 ++#define POWER8_PME_PM_MRK_INST_CMPL 29 ++#define POWER8_PME_PM_MRK_INST_DISP 30 ++#define POWER8_PME_PM_MRK_INST_FROM_L3MISS 31 ++#define POWER8_PME_PM_MRK_L1_ICACHE_MISS 32 ++#define POWER8_PME_PM_MRK_L1_RELOAD_VALID 33 ++#define POWER8_PME_PM_MRK_LD_MISS_L1 34 ++#define POWER8_PME_PM_MRK_ST_CMPL 35 ++#define POWER8_PME_PM_RUN_CYC 36 ++#define POWER8_PME_PM_RUN_INST_CMPL 37 ++#define POWER8_PME_PM_RUN_PURR 38 ++#define POWER8_PME_PM_ST_FIN 39 ++#define POWER8_PME_PM_ST_MISS_L1 40 ++#define POWER8_PME_PM_TB_BIT_TRANS 41 ++#define POWER8_PME_PM_THRD_CONC_RUN_INST 42 ++#define POWER8_PME_PM_THRESH_EXC_1024 43 ++#define POWER8_PME_PM_THRESH_EXC_128 44 ++#define POWER8_PME_PM_THRESH_EXC_2048 45 ++#define POWER8_PME_PM_THRESH_EXC_256 46 ++#define POWER8_PME_PM_THRESH_EXC_32 47 ++#define POWER8_PME_PM_THRESH_EXC_4096 48 ++#define POWER8_PME_PM_THRESH_EXC_512 49 ++#define POWER8_PME_PM_THRESH_EXC_64 50 ++#define POWER8_PME_PM_THRESH_MET 51 ++#define POWER8_PME_PM_BR_2PATH 52 ++#define POWER8_PME_PM_BR_CMPL 53 ++#define POWER8_PME_PM_BR_MRK_2PATH 54 ++#define POWER8_PME_PM_CMPLU_STALL 55 ++#define POWER8_PME_PM_CMPLU_STALL_BRU 56 ++#define POWER8_PME_PM_CMPLU_STALL_BRU_CRU 57 ++#define POWER8_PME_PM_CMPLU_STALL_COQ_FULL 58 ++#define POWER8_PME_PM_CMPLU_STALL_DCACHE_MISS 59 ++#define POWER8_PME_PM_CMPLU_STALL_DMISS_L21_L31 60 ++#define POWER8_PME_PM_CMPLU_STALL_DMISS_L2L3 61 ++#define POWER8_PME_PM_CMPLU_STALL_DMISS_L2L3_CONFLICT 62 ++#define POWER8_PME_PM_CMPLU_STALL_DMISS_L3MISS 63 ++#define POWER8_PME_PM_CMPLU_STALL_DMISS_LMEM 64 ++#define POWER8_PME_PM_CMPLU_STALL_DMISS_REMOTE 65 ++#define POWER8_PME_PM_CMPLU_STALL_ERAT_MISS 66 ++#define POWER8_PME_PM_CMPLU_STALL_FLUSH 67 ++#define POWER8_PME_PM_CMPLU_STALL_FXLONG 68 ++#define POWER8_PME_PM_CMPLU_STALL_FXU 69 ++#define POWER8_PME_PM_CMPLU_STALL_HWSYNC 70 ++#define POWER8_PME_PM_CMPLU_STALL_LOAD_FINISH 71 ++#define POWER8_PME_PM_CMPLU_STALL_LSU 72 ++#define POWER8_PME_PM_CMPLU_STALL_LWSYNC 73 ++#define POWER8_PME_PM_CMPLU_STALL_MEM_ECC_DELAY 74 ++#define POWER8_PME_PM_CMPLU_STALL_NTCG_FLUSH 75 ++#define POWER8_PME_PM_CMPLU_STALL_OTHER_CMPL 76 ++#define POWER8_PME_PM_CMPLU_STALL_REJECT 77 ++#define POWER8_PME_PM_CMPLU_STALL_REJECT_LHS 78 ++#define POWER8_PME_PM_CMPLU_STALL_REJ_LMQ_FULL 79 ++#define POWER8_PME_PM_CMPLU_STALL_SCALAR 80 ++#define POWER8_PME_PM_CMPLU_STALL_SCALAR_LONG 81 ++#define POWER8_PME_PM_CMPLU_STALL_STORE 82 ++#define POWER8_PME_PM_CMPLU_STALL_ST_FWD 83 ++#define POWER8_PME_PM_CMPLU_STALL_THRD 84 ++#define POWER8_PME_PM_CMPLU_STALL_VECTOR 85 ++#define POWER8_PME_PM_CMPLU_STALL_VECTOR_LONG 86 ++#define POWER8_PME_PM_CMPLU_STALL_VSU 87 ++#define POWER8_PME_PM_DATA_FROM_L2 88 ++#define POWER8_PME_PM_DATA_FROM_L2_NO_CONFLICT 89 ++#define POWER8_PME_PM_DATA_FROM_L3 90 ++#define POWER8_PME_PM_DATA_FROM_L3MISS_MOD 91 ++#define POWER8_PME_PM_DATA_FROM_L3_NO_CONFLICT 92 ++#define POWER8_PME_PM_DATA_FROM_LMEM 93 ++#define POWER8_PME_PM_DATA_FROM_MEMORY 94 ++#define POWER8_PME_PM_DC_PREF_STREAM_STRIDED_CONF 95 ++#define POWER8_PME_PM_GCT_NOSLOT_BR_MPRED 96 ++#define POWER8_PME_PM_GCT_NOSLOT_BR_MPRED_ICMISS 97 ++#define POWER8_PME_PM_GCT_NOSLOT_DISP_HELD_ISSQ 98 ++#define POWER8_PME_PM_GCT_NOSLOT_DISP_HELD_OTHER 99 ++#define POWER8_PME_PM_GCT_NOSLOT_DISP_HELD_SRQ 100 ++#define POWER8_PME_PM_GCT_NOSLOT_IC_L3MISS 101 ++#define POWER8_PME_PM_GCT_NOSLOT_IC_MISS 102 ++#define POWER8_PME_PM_GRP_DISP 103 ++#define POWER8_PME_PM_GRP_MRK 104 ++#define POWER8_PME_PM_HV_CYC 105 ++#define POWER8_PME_PM_INST_CMPL 106 ++#define POWER8_PME_PM_IOPS_CMPL 107 ++#define POWER8_PME_PM_LD_CMPL 108 ++#define POWER8_PME_PM_LD_L3MISS_PEND_CYC 109 ++#define POWER8_PME_PM_MRK_DATA_FROM_L2 110 ++#define POWER8_PME_PM_MRK_DATA_FROM_L2MISS_CYC 111 ++#define POWER8_PME_PM_MRK_DATA_FROM_L2_CYC 112 ++#define POWER8_PME_PM_MRK_DATA_FROM_L2_NO_CONFLICT 113 ++#define POWER8_PME_PM_MRK_DATA_FROM_L2_NO_CONFLICT_CYC 114 ++#define POWER8_PME_PM_MRK_DATA_FROM_L3 115 ++#define POWER8_PME_PM_MRK_DATA_FROM_L3MISS_CYC 116 ++#define POWER8_PME_PM_MRK_DATA_FROM_L3_CYC 117 ++#define POWER8_PME_PM_MRK_DATA_FROM_L3_NO_CONFLICT 118 ++#define POWER8_PME_PM_MRK_DATA_FROM_L3_NO_CONFLICT_CYC 119 ++#define POWER8_PME_PM_MRK_DATA_FROM_LL4 120 ++#define POWER8_PME_PM_MRK_DATA_FROM_LL4_CYC 121 ++#define POWER8_PME_PM_MRK_DATA_FROM_LMEM 122 ++#define POWER8_PME_PM_MRK_DATA_FROM_LMEM_CYC 123 ++#define POWER8_PME_PM_MRK_DATA_FROM_MEMORY 124 ++#define POWER8_PME_PM_MRK_DATA_FROM_MEMORY_CYC 125 ++#define POWER8_PME_PM_MRK_GRP_CMPL 126 ++#define POWER8_PME_PM_MRK_INST_DECODED 127 ++#define POWER8_PME_PM_MRK_L2_RC_DISP 128 ++#define POWER8_PME_PM_MRK_LD_MISS_L1_CYC 129 ++#define POWER8_PME_PM_MRK_STALL_CMPLU_CYC 130 ++#define POWER8_PME_PM_NEST_REF_CLK 131 ++#define POWER8_PME_PM_PMC1_OVERFLOW 132 ++#define POWER8_PME_PM_PMC2_OVERFLOW 133 ++#define POWER8_PME_PM_PMC3_OVERFLOW 134 ++#define POWER8_PME_PM_PMC4_OVERFLOW 135 ++#define POWER8_PME_PM_PMC6_OVERFLOW 136 ++#define POWER8_PME_PM_PPC_CMPL 137 ++#define POWER8_PME_PM_THRD_ALL_RUN_CYC 138 ++#define POWER8_PME_PM_THRESH_NOT_MET 139 ++ ++static const pme_power_entry_t power8_pe[] = { ++[ POWER8_PME_PM_1PLUS_PPC_CMPL ] = { ++ .pme_name = "PM_1PLUS_PPC_CMPL", ++ .pme_code = 0x100f2, ++ .pme_short_desc = "one or more ppc instructions completed", ++ .pme_long_desc = "one or more ppc instructions finished", ++}, ++[ POWER8_PME_PM_1PLUS_PPC_DISP ] = { ++ .pme_name = "PM_1PLUS_PPC_DISP", ++ .pme_code = 0x400f2, ++ .pme_short_desc = "Cycles at least one Instr Dispatched", ++ .pme_long_desc = "Cycles at least one Instr Dispatched", ++}, ++[ POWER8_PME_PM_ANY_THRD_RUN_CYC ] = { ++ .pme_name = "PM_ANY_THRD_RUN_CYC", ++ .pme_code = 0x100fa, ++ .pme_short_desc = "Any thread in run_cycles (was one thread in run_cycles)", ++ .pme_long_desc = "One of threads in run_cycles", ++}, ++[ POWER8_PME_PM_BR_MPRED_CMPL ] = { ++ .pme_name = "PM_BR_MPRED_CMPL", ++ .pme_code = 0x400f6, ++ .pme_short_desc = "Number of Branch Mispredicts", ++ .pme_long_desc = "Number of Branch Mispredicts", ++}, ++[ POWER8_PME_PM_BR_TAKEN_CMPL ] = { ++ .pme_name = "PM_BR_TAKEN_CMPL", ++ .pme_code = 0x200fa, ++ .pme_short_desc = "Branch Taken", ++ .pme_long_desc = "New event for Branch Taken", ++}, ++[ POWER8_PME_PM_CYC ] = { ++ .pme_name = "PM_CYC", ++ .pme_code = 0x100f0, ++ .pme_short_desc = "Cycles", ++ .pme_long_desc = "Cycles", ++}, ++[ POWER8_PME_PM_DATA_FROM_L2MISS ] = { ++ .pme_name = "PM_DATA_FROM_L2MISS", ++ .pme_code = 0x200fe, ++ .pme_short_desc = "Demand LD - L2 Miss (not L2 hit)", ++ .pme_long_desc = "Demand LD - L2 Miss (not L2 hit)", ++}, ++[ POWER8_PME_PM_DATA_FROM_L3MISS ] = { ++ .pme_name = "PM_DATA_FROM_L3MISS", ++ .pme_code = 0x300fe, ++ .pme_short_desc = "Demand LD - L3 Miss (not L2 hit and not L3 hit)", ++ .pme_long_desc = "Demand LD - L3 Miss (not L2 hit and not L3 hit)", ++}, ++[ POWER8_PME_PM_DATA_FROM_MEM ] = { ++ .pme_name = "PM_DATA_FROM_MEM", ++ .pme_code = 0x400fe, ++ .pme_short_desc = "Data cache reload from memory (including L4)", ++ .pme_long_desc = "data from Memory", ++}, ++[ POWER8_PME_PM_DTLB_MISS ] = { ++ .pme_name = "PM_DTLB_MISS", ++ .pme_code = 0x300fc, ++ .pme_short_desc = "Data PTEG Reloaded (DTLB Miss)", ++ .pme_long_desc = "Data PTEG reload", ++}, ++[ POWER8_PME_PM_EXT_INT ] = { ++ .pme_name = "PM_EXT_INT", ++ .pme_code = 0x200f8, ++ .pme_short_desc = "external interrupt", ++ .pme_long_desc = "external interrupt", ++}, ++[ POWER8_PME_PM_FLOP ] = { ++ .pme_name = "PM_FLOP", ++ .pme_code = 0x100f4, ++ .pme_short_desc = "Floating Point Operations Finished", ++ .pme_long_desc = "Floating Point Operations Finished", ++}, ++[ POWER8_PME_PM_FLUSH ] = { ++ .pme_name = "PM_FLUSH", ++ .pme_code = 0x400f8, ++ .pme_short_desc = "Flush (any type)", ++ .pme_long_desc = "Flush (any type)", ++}, ++[ POWER8_PME_PM_GCT_NOSLOT_CYC ] = { ++ .pme_name = "PM_GCT_NOSLOT_CYC", ++ .pme_code = 0x100f8, ++ .pme_short_desc = "Pipeline empty (No itags assigned , no GCT slots used)", ++ .pme_long_desc = "No itags assigned", ++}, ++[ POWER8_PME_PM_IERAT_MISS ] = { ++ .pme_name = "PM_IERAT_MISS", ++ .pme_code = 0x100f6, ++ .pme_short_desc = "IERAT Reloaded (Miss)", ++ .pme_long_desc = "Cycles Instruction ERAT was reloaded", ++}, ++[ POWER8_PME_PM_INST_DISP ] = { ++ .pme_name = "PM_INST_DISP", ++ .pme_code = 0x200f2, ++ .pme_short_desc = "Number of PPC Dispatched", ++ .pme_long_desc = "Number of PPC Dispatched", ++}, ++[ POWER8_PME_PM_INST_FROM_L3MISS ] = { ++ .pme_name = "PM_INST_FROM_L3MISS", ++ .pme_code = 0x300fa, ++ .pme_short_desc = "Inst from L3 miss", ++ .pme_long_desc = "A Instruction cacheline request resolved from a location that was beyond the local L3 cache", ++}, ++[ POWER8_PME_PM_ITLB_MISS ] = { ++ .pme_name = "PM_ITLB_MISS", ++ .pme_code = 0x400fc, ++ .pme_short_desc = "ITLB Reloaded", ++ .pme_long_desc = "ITLB Reloaded (always zero on POWER6)", ++}, ++[ POWER8_PME_PM_L1_DCACHE_RELOAD_VALID ] = { ++ .pme_name = "PM_L1_DCACHE_RELOAD_VALID", ++ .pme_code = 0x300f6, ++ .pme_short_desc = "DL1 reloaded due to Demand Load", ++ .pme_long_desc = "DL1 reloaded due to Demand Load", ++}, ++[ POWER8_PME_PM_L1_ICACHE_MISS ] = { ++ .pme_name = "PM_L1_ICACHE_MISS", ++ .pme_code = 0x200fc, ++ .pme_short_desc = "Demand iCache Miss", ++ .pme_long_desc = "Demand iCache Miss", ++}, ++[ POWER8_PME_PM_LD_MISS_L1 ] = { ++ .pme_name = "PM_LD_MISS_L1", ++ .pme_code = 0x400f0, ++ .pme_short_desc = "Load Missed L1", ++ .pme_long_desc = "Load Missed L1", ++}, ++[ POWER8_PME_PM_LSU_DERAT_MISS ] = { ++ .pme_name = "PM_LSU_DERAT_MISS", ++ .pme_code = 0x200f6, ++ .pme_short_desc = "DERAT Reloaded (Miss)", ++ .pme_long_desc = "DERAT Reloaded due to a DERAT miss", ++}, ++[ POWER8_PME_PM_MRK_BR_MPRED_CMPL ] = { ++ .pme_name = "PM_MRK_BR_MPRED_CMPL", ++ .pme_code = 0x300e4, ++ .pme_short_desc = "Marked Branch Mispredicted", ++ .pme_long_desc = "Marked Branch Mispredicted", ++}, ++[ POWER8_PME_PM_MRK_BR_TAKEN_CMPL ] = { ++ .pme_name = "PM_MRK_BR_TAKEN_CMPL", ++ .pme_code = 0x100e2, ++ .pme_short_desc = "Marked Branch Taken", ++ .pme_long_desc = "Marked Branch Taken completed", ++}, ++[ POWER8_PME_PM_MRK_DATA_FROM_L2MISS ] = { ++ .pme_name = "PM_MRK_DATA_FROM_L2MISS", ++ .pme_code = 0x400e8, ++ .pme_short_desc = "Data cache reload L2 miss", ++ .pme_long_desc = "sampled load resolved beyond L2", ++}, ++[ POWER8_PME_PM_MRK_DATA_FROM_L3MISS ] = { ++ .pme_name = "PM_MRK_DATA_FROM_L3MISS", ++ .pme_code = 0x200e4, ++ .pme_short_desc = "The processor's data cache was reloaded from a location other than the local core's L3 due to a marked load", ++ .pme_long_desc = "sampled load resolved beyond L3", ++}, ++[ POWER8_PME_PM_MRK_DATA_FROM_MEM ] = { ++ .pme_name = "PM_MRK_DATA_FROM_MEM", ++ .pme_code = 0x200e0, ++ .pme_short_desc = "The processor's data cache was reloaded from a memory location including L4 from local remote or distant due to a marked load", ++ .pme_long_desc = "sampled load resolved from memory", ++}, ++[ POWER8_PME_PM_MRK_DERAT_MISS ] = { ++ .pme_name = "PM_MRK_DERAT_MISS", ++ .pme_code = 0x300e6, ++ .pme_short_desc = "Erat Miss (TLB Access) All page sizes", ++ .pme_long_desc = "Erat Miss (TLB Access) All page sizes", ++}, ++[ POWER8_PME_PM_MRK_DTLB_MISS ] = { ++ .pme_name = "PM_MRK_DTLB_MISS", ++ .pme_code = 0x400e4, ++ .pme_short_desc = "Marked dtlb miss", ++ .pme_long_desc = "sampled Instruction dtlb miss", ++}, ++[ POWER8_PME_PM_MRK_INST_CMPL ] = { ++ .pme_name = "PM_MRK_INST_CMPL", ++ .pme_code = 0x400e0, ++ .pme_short_desc = "marked instruction completed", ++ .pme_long_desc = "Marked group complete", ++}, ++[ POWER8_PME_PM_MRK_INST_DISP ] = { ++ .pme_name = "PM_MRK_INST_DISP", ++ .pme_code = 0x100e0, ++ .pme_short_desc = "Marked Instruction dispatched", ++ .pme_long_desc = "The thread has dispatched a randomly sampled marked instruction", ++}, ++[ POWER8_PME_PM_MRK_INST_FROM_L3MISS ] = { ++ .pme_name = "PM_MRK_INST_FROM_L3MISS", ++ .pme_code = 0x400e6, ++ .pme_short_desc = "sampled instruction missed icache and came from beyond L3 A Instruction cacheline request for a marked/sampled instruction resolved from a location that was beyond the local L3 cache", ++ .pme_long_desc = "sampled instruction missed icache and came from beyond L3 A Instruction cacheline request for a marked/sampled instruction resolved from a location that was beyond the local L3 cache", ++}, ++[ POWER8_PME_PM_MRK_L1_ICACHE_MISS ] = { ++ .pme_name = "PM_MRK_L1_ICACHE_MISS", ++ .pme_code = 0x100e4, ++ .pme_short_desc = "Marked L1 Icache Miss", ++ .pme_long_desc = "sampled Instruction suffered an icache Miss", ++}, ++[ POWER8_PME_PM_MRK_L1_RELOAD_VALID ] = { ++ .pme_name = "PM_MRK_L1_RELOAD_VALID", ++ .pme_code = 0x100ea, ++ .pme_short_desc = "Marked demand reload", ++ .pme_long_desc = "Sampled Instruction had a data reload", ++}, ++[ POWER8_PME_PM_MRK_LD_MISS_L1 ] = { ++ .pme_name = "PM_MRK_LD_MISS_L1", ++ .pme_code = 0x200e2, ++ .pme_short_desc = "Marked DL1 Demand Miss counted at exec time", ++ .pme_long_desc = "Marked DL1 Demand Miss", ++}, ++[ POWER8_PME_PM_MRK_ST_CMPL ] = { ++ .pme_name = "PM_MRK_ST_CMPL", ++ .pme_code = 0x300e2, ++ .pme_short_desc = "Marked store completed", ++ .pme_long_desc = "marked store completed and sent to nest", ++}, ++[ POWER8_PME_PM_RUN_CYC ] = { ++ .pme_name = "PM_RUN_CYC", ++ .pme_code = 0x600f4, ++ .pme_short_desc = "Run_cycles", ++ .pme_long_desc = "Run_cycles", ++}, ++[ POWER8_PME_PM_RUN_INST_CMPL ] = { ++ .pme_name = "PM_RUN_INST_CMPL", ++ .pme_code = 0x500fa, ++ .pme_short_desc = "Run_Instructions", ++ .pme_long_desc = "Run_Instructions", ++}, ++[ POWER8_PME_PM_RUN_PURR ] = { ++ .pme_name = "PM_RUN_PURR", ++ .pme_code = 0x400f4, ++ .pme_short_desc = "Run_PURR", ++ .pme_long_desc = "Run_PURR", ++}, ++[ POWER8_PME_PM_ST_FIN ] = { ++ .pme_name = "PM_ST_FIN", ++ .pme_code = 0x200f0, ++ .pme_short_desc = "Store Instructions Finished (store sent to nest)", ++ .pme_long_desc = "Store Instructions Finished", ++}, ++[ POWER8_PME_PM_ST_MISS_L1 ] = { ++ .pme_name = "PM_ST_MISS_L1", ++ .pme_code = 0x300f0, ++ .pme_short_desc = "Store Missed L1", ++ .pme_long_desc = "Store Missed L1", ++}, ++[ POWER8_PME_PM_TB_BIT_TRANS ] = { ++ .pme_name = "PM_TB_BIT_TRANS", ++ .pme_code = 0x300f8, ++ .pme_short_desc = "timebase event", ++ .pme_long_desc = "timebase event", ++}, ++[ POWER8_PME_PM_THRD_CONC_RUN_INST ] = { ++ .pme_name = "PM_THRD_CONC_RUN_INST", ++ .pme_code = 0x300f4, ++ .pme_short_desc = "Concurrent Run Instructions", ++ .pme_long_desc = "PPC Instructions Finished when both threads in run_cycles", ++}, ++[ POWER8_PME_PM_THRESH_EXC_1024 ] = { ++ .pme_name = "PM_THRESH_EXC_1024", ++ .pme_code = 0x300ea, ++ .pme_short_desc = "Threshold counter exceeded a value of 1024 Architecture provides a thresholding counter in MMCRA, it has a start and stop events to configure and a programmable threshold, this event increments when the threshold exceeded a count of 1024", ++ .pme_long_desc = "Threshold counter exceeded a value of 1024 Architecture provides a thresholding counter in MMCRA, it has a start and stop events to configure and a programmable threshold, this event increments when the threshold exceeded a count of 1024", ++}, ++[ POWER8_PME_PM_THRESH_EXC_128 ] = { ++ .pme_name = "PM_THRESH_EXC_128", ++ .pme_code = 0x400ea, ++ .pme_short_desc = "Threshold counter exceeded a value of 128", ++ .pme_long_desc = "Architecture provides a thresholding counter in MMCRA, it has a start and stop events to configure and a programmable threshold, this event increments when the threshold exceeded a count of 128", ++}, ++[ POWER8_PME_PM_THRESH_EXC_2048 ] = { ++ .pme_name = "PM_THRESH_EXC_2048", ++ .pme_code = 0x400ec, ++ .pme_short_desc = "Threshold counter exceeded a value of 2048", ++ .pme_long_desc = "Architecture provides a thresholding counter in MMCRA, it has a start and stop events to configure and a programmable threshold, this event increments when the threshold exceeded a count of 2048", ++}, ++[ POWER8_PME_PM_THRESH_EXC_256 ] = { ++ .pme_name = "PM_THRESH_EXC_256", ++ .pme_code = 0x100e8, ++ .pme_short_desc = "Threshold counter exceed a count of 256", ++ .pme_long_desc = "Architecture provides a thresholding counter in MMCRA, it has a start and stop events to configure and a programmable threshold, this event increments when the threshold exceeded a count of 256", ++}, ++[ POWER8_PME_PM_THRESH_EXC_32 ] = { ++ .pme_name = "PM_THRESH_EXC_32", ++ .pme_code = 0x200e6, ++ .pme_short_desc = "Threshold counter exceeded a value of 32", ++ .pme_long_desc = "Architecture provides a thresholding counter in MMCRA, it has a start and stop events to configure and a programmable threshold, this event increments when the threshold exceeded a count of 32", ++}, ++[ POWER8_PME_PM_THRESH_EXC_4096 ] = { ++ .pme_name = "PM_THRESH_EXC_4096", ++ .pme_code = 0x100e6, ++ .pme_short_desc = "Threshold counter exceed a count of 4096", ++ .pme_long_desc = "Architecture provides a thresholding counter in MMCRA, it has a start and stop events to configure and a programmable threshold, this event increments when the threshold exceeded a count of 4096", ++}, ++[ POWER8_PME_PM_THRESH_EXC_512 ] = { ++ .pme_name = "PM_THRESH_EXC_512", ++ .pme_code = 0x200e8, ++ .pme_short_desc = "Threshold counter exceeded a value of 512 Architecture provides a thresholding counter in MMCRA, it has a start and stop events to configure and a programmable threshold, this event increments when the threshold exceeded a count of 512", ++ .pme_long_desc = "Threshold counter exceeded a value of 512 Architecture provides a thresholding counter in MMCRA, it has a start and stop events to configure and a programmable threshold, this event increments when the threshold exceeded a count of 512", ++}, ++[ POWER8_PME_PM_THRESH_EXC_64 ] = { ++ .pme_name = "PM_THRESH_EXC_64", ++ .pme_code = 0x300e8, ++ .pme_short_desc = "Threshold counter exceeded a value of 64 Architecture provides a thresholding counter in MMCRA, it has a start and stop events to configure and a programmable threshold, this event increments when the threshold exceeded a count of 64", ++ .pme_long_desc = "Threshold counter exceeded a value of 64 Architecture provides a thresholding counter in MMCRA, it has a start and stop events to configure and a programmable threshold, this event increments when the threshold exceeded a count of 64", ++}, ++[ POWER8_PME_PM_THRESH_MET ] = { ++ .pme_name = "PM_THRESH_MET", ++ .pme_code = 0x100ec, ++ .pme_short_desc = "threshold exceeded", ++ .pme_long_desc = "Threshold exceeded", ++}, ++[ POWER8_PME_PM_BR_2PATH ] = { ++ .pme_name = "PM_BR_2PATH", ++ .pme_code = 0x40036, ++ .pme_short_desc = "two path branch", ++ .pme_long_desc = "two path branch.", ++}, ++[ POWER8_PME_PM_BR_CMPL ] = { ++ .pme_name = "PM_BR_CMPL", ++ .pme_code = 0x40060, ++ .pme_short_desc = "Branch Instruction completed", ++ .pme_long_desc = "Branch Instruction completed.", ++}, ++[ POWER8_PME_PM_BR_MRK_2PATH ] = { ++ .pme_name = "PM_BR_MRK_2PATH", ++ .pme_code = 0x40138, ++ .pme_short_desc = "marked two path branch", ++ .pme_long_desc = "marked two path branch.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL ] = { ++ .pme_name = "PM_CMPLU_STALL", ++ .pme_code = 0x1e054, ++ .pme_short_desc = "Completion stall", ++ .pme_long_desc = "Completion stall.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_BRU ] = { ++ .pme_name = "PM_CMPLU_STALL_BRU", ++ .pme_code = 0x4d018, ++ .pme_short_desc = "Completion stall due to a Branch Unit", ++ .pme_long_desc = "Completion stall due to a Branch Unit.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_BRU_CRU ] = { ++ .pme_name = "PM_CMPLU_STALL_BRU_CRU", ++ .pme_code = 0x2d018, ++ .pme_short_desc = "Completion stall due to IFU", ++ .pme_long_desc = "Completion stall due to IFU.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_COQ_FULL ] = { ++ .pme_name = "PM_CMPLU_STALL_COQ_FULL", ++ .pme_code = 0x30026, ++ .pme_short_desc = "Completion stall due to CO q full", ++ .pme_long_desc = "Completion stall due to CO q full.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_DCACHE_MISS ] = { ++ .pme_name = "PM_CMPLU_STALL_DCACHE_MISS", ++ .pme_code = 0x2c012, ++ .pme_short_desc = "Completion stall by Dcache miss", ++ .pme_long_desc = "Completion stall by Dcache miss.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_DMISS_L21_L31 ] = { ++ .pme_name = "PM_CMPLU_STALL_DMISS_L21_L31", ++ .pme_code = 0x2c018, ++ .pme_short_desc = "Completion stall by Dcache miss which resolved on chip ( excluding local L2/L3)", ++ .pme_long_desc = "Completion stall by Dcache miss which resolved on chip ( excluding local L2/L3).", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_DMISS_L2L3 ] = { ++ .pme_name = "PM_CMPLU_STALL_DMISS_L2L3", ++ .pme_code = 0x2c016, ++ .pme_short_desc = "Completion stall by Dcache miss which resolved in L2/L3", ++ .pme_long_desc = "Completion stall by Dcache miss which resolved in L2/L3.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_DMISS_L2L3_CONFLICT ] = { ++ .pme_name = "PM_CMPLU_STALL_DMISS_L2L3_CONFLICT", ++ .pme_code = 0x4c016, ++ .pme_short_desc = "Completion stall due to cache miss due to L2 l3 conflict", ++ .pme_long_desc = "Completion stall due to cache miss resolving in core's L2/L3 with a conflict.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_DMISS_L3MISS ] = { ++ .pme_name = "PM_CMPLU_STALL_DMISS_L3MISS", ++ .pme_code = 0x4c01a, ++ .pme_short_desc = "Completion stall due to cache miss resolving missed the L3", ++ .pme_long_desc = "Completion stall due to cache miss resolving missed the L3.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_DMISS_LMEM ] = { ++ .pme_name = "PM_CMPLU_STALL_DMISS_LMEM", ++ .pme_code = 0x4c018, ++ .pme_short_desc = "GCT empty by branch mispredict + IC miss", ++ .pme_long_desc = "Completion stall due to cache miss resolving in core's Local Memory.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_DMISS_REMOTE ] = { ++ .pme_name = "PM_CMPLU_STALL_DMISS_REMOTE", ++ .pme_code = 0x2c01c, ++ .pme_short_desc = "Completion stall by Dcache miss which resolved from remote chip (cache or memory)", ++ .pme_long_desc = "Completion stall by Dcache miss which resolved on chip ( excluding local L2/L3).", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_ERAT_MISS ] = { ++ .pme_name = "PM_CMPLU_STALL_ERAT_MISS", ++ .pme_code = 0x4c012, ++ .pme_short_desc = "Completion stall due to LSU reject ERAT miss", ++ .pme_long_desc = "Completion stall due to LSU reject ERAT miss.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_FLUSH ] = { ++ .pme_name = "PM_CMPLU_STALL_FLUSH", ++ .pme_code = 0x30038, ++ .pme_short_desc = "completion stall due to flush by own thread", ++ .pme_long_desc = "completion stall due to flush by own thread.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_FXLONG ] = { ++ .pme_name = "PM_CMPLU_STALL_FXLONG", ++ .pme_code = 0x4d016, ++ .pme_short_desc = "Completion stall due to a long latency fixed point instruction", ++ .pme_long_desc = "Completion stall due to a long latency fixed point instruction.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_FXU ] = { ++ .pme_name = "PM_CMPLU_STALL_FXU", ++ .pme_code = 0x2d016, ++ .pme_short_desc = "Completion stall due to FXU", ++ .pme_long_desc = "Completion stall due to FXU.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_HWSYNC ] = { ++ .pme_name = "PM_CMPLU_STALL_HWSYNC", ++ .pme_code = 0x30036, ++ .pme_short_desc = "completion stall due to hwsync", ++ .pme_long_desc = "completion stall due to hwsync.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_LOAD_FINISH ] = { ++ .pme_name = "PM_CMPLU_STALL_LOAD_FINISH", ++ .pme_code = 0x4d014, ++ .pme_short_desc = "Completion stall due to a Load finish", ++ .pme_long_desc = "Completion stall due to a Load finish.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_LSU ] = { ++ .pme_name = "PM_CMPLU_STALL_LSU", ++ .pme_code = 0x2c010, ++ .pme_short_desc = "Completion stall by LSU instruction", ++ .pme_long_desc = "Completion stall by LSU instruction.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_LWSYNC ] = { ++ .pme_name = "PM_CMPLU_STALL_LWSYNC", ++ .pme_code = 0x10036, ++ .pme_short_desc = "completion stall due to isync/lwsync", ++ .pme_long_desc = "completion stall due to isync/lwsync.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_MEM_ECC_DELAY ] = { ++ .pme_name = "PM_CMPLU_STALL_MEM_ECC_DELAY", ++ .pme_code = 0x30028, ++ .pme_short_desc = "Completion stall due to mem ECC delay", ++ .pme_long_desc = "Completion stall due to mem ECC delay.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_NTCG_FLUSH ] = { ++ .pme_name = "PM_CMPLU_STALL_NTCG_FLUSH", ++ .pme_code = 0x2e01e, ++ .pme_short_desc = "Completion stall due to ntcg flush", ++ .pme_long_desc = "Completion stall due to reject (load hit store).", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_OTHER_CMPL ] = { ++ .pme_name = "PM_CMPLU_STALL_OTHER_CMPL", ++ .pme_code = 0x30006, ++ .pme_short_desc = "Instructions core completed while this thread was stalled.", ++ .pme_long_desc = "Instructions core completed while this thread was stalled.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_REJECT ] = { ++ .pme_name = "PM_CMPLU_STALL_REJECT", ++ .pme_code = 0x4c010, ++ .pme_short_desc = "Completion stall due to LSU reject", ++ .pme_long_desc = "Completion stall due to LSU reject.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_REJECT_LHS ] = { ++ .pme_name = "PM_CMPLU_STALL_REJECT_LHS", ++ .pme_code = 0x2c01a, ++ .pme_short_desc = "Completion stall due to reject (load hit store)", ++ .pme_long_desc = "Completion stall due to reject (load hit store).", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_REJ_LMQ_FULL ] = { ++ .pme_name = "PM_CMPLU_STALL_REJ_LMQ_FULL", ++ .pme_code = 0x4c014, ++ .pme_short_desc = "Completion stall due to LSU reject LMQ full", ++ .pme_long_desc = "Completion stall due to LSU reject LMQ full.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_SCALAR ] = { ++ .pme_name = "PM_CMPLU_STALL_SCALAR", ++ .pme_code = 0x4d010, ++ .pme_short_desc = "Completion stall due to VSU scalar instruction", ++ .pme_long_desc = "Completion stall due to VSU scalar instruction.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_SCALAR_LONG ] = { ++ .pme_name = "PM_CMPLU_STALL_SCALAR_LONG", ++ .pme_code = 0x2d010, ++ .pme_short_desc = "Completion stall due to VSU scalar long latency instruction", ++ .pme_long_desc = "Completion stall due to VSU scalar long latency instruction.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_STORE ] = { ++ .pme_name = "PM_CMPLU_STALL_STORE", ++ .pme_code = 0x2c014, ++ .pme_short_desc = "Completion stall by stores this includes store agent finishes in pipe LS0/LS1 and store data finishes in LS2/LS3", ++ .pme_long_desc = "Completion stall by stores.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_ST_FWD ] = { ++ .pme_name = "PM_CMPLU_STALL_ST_FWD", ++ .pme_code = 0x4c01c, ++ .pme_short_desc = "Completion stall due to store forward", ++ .pme_long_desc = "Completion stall due to store forward.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_THRD ] = { ++ .pme_name = "PM_CMPLU_STALL_THRD", ++ .pme_code = 0x1001c, ++ .pme_short_desc = "Completion Stalled due to thread conflict. Group ready to complete but it was another thread's turn", ++ .pme_long_desc = "Completion stall due to thread conflict.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_VECTOR ] = { ++ .pme_name = "PM_CMPLU_STALL_VECTOR", ++ .pme_code = 0x2d014, ++ .pme_short_desc = "Completion stall due to VSU vector instruction", ++ .pme_long_desc = "Completion stall due to VSU vector instruction.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_VECTOR_LONG ] = { ++ .pme_name = "PM_CMPLU_STALL_VECTOR_LONG", ++ .pme_code = 0x4d012, ++ .pme_short_desc = "Completion stall due to VSU vector long instruction", ++ .pme_long_desc = "Completion stall due to VSU vector long instruction.", ++}, ++[ POWER8_PME_PM_CMPLU_STALL_VSU ] = { ++ .pme_name = "PM_CMPLU_STALL_VSU", ++ .pme_code = 0x2d012, ++ .pme_short_desc = "Completion stall due to VSU instruction", ++ .pme_long_desc = "Completion stall due to VSU instruction.", ++}, ++[ POWER8_PME_PM_DATA_FROM_L2 ] = { ++ .pme_name = "PM_DATA_FROM_L2", ++ .pme_code = 0x1c042, ++ .pme_short_desc = "The processor's data cache was reloaded from local core's L2 due to a demand load or demand load plus prefetch controlled by MMCR1[16]", ++ .pme_long_desc = "The processor's data cache was reloaded from local core's L2 due to a demand load or demand load plus prefetch controlled by MMCR1[20].", ++}, ++[ POWER8_PME_PM_DATA_FROM_L2_NO_CONFLICT ] = { ++ .pme_name = "PM_DATA_FROM_L2_NO_CONFLICT", ++ .pme_code = 0x1c040, ++ .pme_short_desc = "The processor's data cache was reloaded from local core's L2 without conflict due to a demand load or demand load plus prefetch controlled by MMCR1[16]", ++ .pme_long_desc = "The processor's data cache was reloaded from local core's L2 without conflict due to a demand load or demand load plus prefetch controlled by MMCR1[20] .", ++}, ++[ POWER8_PME_PM_DATA_FROM_L3 ] = { ++ .pme_name = "PM_DATA_FROM_L3", ++ .pme_code = 0x4c042, ++ .pme_short_desc = "The processor's data cache was reloaded from local core's L3 due to a demand load", ++ .pme_long_desc = "The processor's data cache was reloaded from local core's L3 due to a demand load.", ++}, ++[ POWER8_PME_PM_DATA_FROM_L3MISS_MOD ] = { ++ .pme_name = "PM_DATA_FROM_L3MISS_MOD", ++ .pme_code = 0x4c04e, ++ .pme_short_desc = "The processor's data cache was reloaded from a location other than the local core's L3 due to a demand load", ++ .pme_long_desc = "The processor's data cache was reloaded from a location other than the local core's L3 due to a demand load.", ++}, ++[ POWER8_PME_PM_DATA_FROM_L3_NO_CONFLICT ] = { ++ .pme_name = "PM_DATA_FROM_L3_NO_CONFLICT", ++ .pme_code = 0x1c044, ++ .pme_short_desc = "The processor's data cache was reloaded from local core's L3 without conflict due to a demand load or demand load plus prefetch controlled by MMCR1[16]", ++ .pme_long_desc = "The processor's data cache was reloaded from local core's L3 without conflict due to a demand load or demand load plus prefetch controlled by MMCR1[20].", ++}, ++[ POWER8_PME_PM_DATA_FROM_LMEM ] = { ++ .pme_name = "PM_DATA_FROM_LMEM", ++ .pme_code = 0x2c048, ++ .pme_short_desc = "The processor's data cache was reloaded from the local chip's Memory due to a demand load", ++ .pme_long_desc = "The processor's data cache was reloaded from the local chip's Memory due to a demand load.", ++}, ++[ POWER8_PME_PM_DATA_FROM_MEMORY ] = { ++ .pme_name = "PM_DATA_FROM_MEMORY", ++ .pme_code = 0x2c04c, ++ .pme_short_desc = "The processor's data cache was reloaded from a memory location including L4 from local remote or distant due to a demand load", ++ .pme_long_desc = "The processor's data cache was reloaded from a memory location including L4 from local remote or distant due to a demand load.", ++}, ++[ POWER8_PME_PM_DC_PREF_STREAM_STRIDED_CONF ] = { ++ .pme_name = "PM_DC_PREF_STREAM_STRIDED_CONF", ++ .pme_code = 0x3e050, ++ .pme_short_desc = "A demand load referenced a line in an active strided prefetch stream. The stream could have been allocated through the hardware prefetch mechanism or through software.", ++ .pme_long_desc = "A demand load referenced a line in an active strided prefetch stream. The stream could have been allocated through the hardware prefetch mechanism or through software..", ++}, ++[ POWER8_PME_PM_GCT_NOSLOT_BR_MPRED ] = { ++ .pme_name = "PM_GCT_NOSLOT_BR_MPRED", ++ .pme_code = 0x4d01e, ++ .pme_short_desc = "Gct empty fo this thread due to branch misprediction", ++ .pme_long_desc = "Gct empty for this thread due to branch misprediction.", ++}, ++[ POWER8_PME_PM_GCT_NOSLOT_BR_MPRED_ICMISS ] = { ++ .pme_name = "PM_GCT_NOSLOT_BR_MPRED_ICMISS", ++ .pme_code = 0x4d01a, ++ .pme_short_desc = "Gct empty for this thread due to Icache Miss and branch mispred", ++ .pme_long_desc = "Gct empty for this thread due to Icache Miss and branch mispred.", ++}, ++[ POWER8_PME_PM_GCT_NOSLOT_DISP_HELD_ISSQ ] = { ++ .pme_name = "PM_GCT_NOSLOT_DISP_HELD_ISSQ", ++ .pme_code = 0x2d01e, ++ .pme_short_desc = "Gct empty for this thread due to dispatch hold on this thread due to Issue q full", ++ .pme_long_desc = "Gct empty for this thread due to dispatch hold on this thread due to Issue q full.", ++}, ++[ POWER8_PME_PM_GCT_NOSLOT_DISP_HELD_OTHER ] = { ++ .pme_name = "PM_GCT_NOSLOT_DISP_HELD_OTHER", ++ .pme_code = 0x2e010, ++ .pme_short_desc = "Gct empty for this thread due to dispatch hold on this thread due to sync", ++ .pme_long_desc = "Gct empty for this thread due to dispatch hold on this thread due to sync.", ++}, ++[ POWER8_PME_PM_GCT_NOSLOT_DISP_HELD_SRQ ] = { ++ .pme_name = "PM_GCT_NOSLOT_DISP_HELD_SRQ", ++ .pme_code = 0x2d01c, ++ .pme_short_desc = "Gct empty for this thread due to dispatch hold on this thread due to SRQ full", ++ .pme_long_desc = "Gct empty for this thread due to dispatch hold on this thread due to SRQ full.", ++}, ++[ POWER8_PME_PM_GCT_NOSLOT_IC_L3MISS ] = { ++ .pme_name = "PM_GCT_NOSLOT_IC_L3MISS", ++ .pme_code = 0x4e010, ++ .pme_short_desc = "Gct empty for this thread due to icach l3 miss", ++ .pme_long_desc = "Gct empty for this thread due to icach l3 miss.", ++}, ++[ POWER8_PME_PM_GCT_NOSLOT_IC_MISS ] = { ++ .pme_name = "PM_GCT_NOSLOT_IC_MISS", ++ .pme_code = 0x2d01a, ++ .pme_short_desc = "Gct empty for this thread due to Icache Miss", ++ .pme_long_desc = "Gct empty for this thread due to Icache Miss.", ++}, ++[ POWER8_PME_PM_GRP_DISP ] = { ++ .pme_name = "PM_GRP_DISP", ++ .pme_code = 0x3000a, ++ .pme_short_desc = "group dispatch", ++ .pme_long_desc = "dispatch_success (Group Dispatched).", ++}, ++[ POWER8_PME_PM_GRP_MRK ] = { ++ .pme_name = "PM_GRP_MRK", ++ .pme_code = 0x10130, ++ .pme_short_desc = "Instruction Marked", ++ .pme_long_desc = "Instruction marked in idu.", ++}, ++[ POWER8_PME_PM_HV_CYC ] = { ++ .pme_name = "PM_HV_CYC", ++ .pme_code = 0x2000a, ++ .pme_short_desc = "cycles in hypervisor mode", ++ .pme_long_desc = "cycles in hypervisor mode .", ++}, ++[ POWER8_PME_PM_INST_CMPL ] = { ++ .pme_name = "PM_INST_CMPL", ++ .pme_code = 0x10002, ++ .pme_short_desc = "Number of PowerPC Instructions that completed.", ++ .pme_long_desc = "PPC Instructions Finished (completed).", ++}, ++[ POWER8_PME_PM_IOPS_CMPL ] = { ++ .pme_name = "PM_IOPS_CMPL", ++ .pme_code = 0x10014, ++ .pme_short_desc = "Internal Operations completed", ++ .pme_long_desc = "IOPS Completed.", ++}, ++[ POWER8_PME_PM_LD_CMPL ] = { ++ .pme_name = "PM_LD_CMPL", ++ .pme_code = 0x1002e, ++ .pme_short_desc = "count of Loads completed", ++ .pme_long_desc = "count of Loads completed.", ++}, ++[ POWER8_PME_PM_LD_L3MISS_PEND_CYC ] = { ++ .pme_name = "PM_LD_L3MISS_PEND_CYC", ++ .pme_code = 0x10062, ++ .pme_short_desc = "Cycles L3 miss was pending for this thread", ++ .pme_long_desc = "Cycles L3 miss was pending for this thread.", ++}, ++[ POWER8_PME_PM_MRK_DATA_FROM_L2 ] = { ++ .pme_name = "PM_MRK_DATA_FROM_L2", ++ .pme_code = 0x1d142, ++ .pme_short_desc = "The processor's data cache was reloaded from local core's L2 due to a marked load", ++ .pme_long_desc = "The processor's data cache was reloaded from local core's L2 due to a marked load.", ++}, ++[ POWER8_PME_PM_MRK_DATA_FROM_L2MISS_CYC ] = { ++ .pme_name = "PM_MRK_DATA_FROM_L2MISS_CYC", ++ .pme_code = 0x4c12e, ++ .pme_short_desc = "Duration in cycles to reload from a location other than the local core's L2 due to a marked load", ++ .pme_long_desc = "Duration in cycles to reload from a location other than the local core's L2 due to a marked load.", ++}, ++[ POWER8_PME_PM_MRK_DATA_FROM_L2_CYC ] = { ++ .pme_name = "PM_MRK_DATA_FROM_L2_CYC", ++ .pme_code = 0x4c122, ++ .pme_short_desc = "Duration in cycles to reload from local core's L2 due to a marked load", ++ .pme_long_desc = "Duration in cycles to reload from local core's L2 due to a marked load.", ++}, ++[ POWER8_PME_PM_MRK_DATA_FROM_L2_NO_CONFLICT ] = { ++ .pme_name = "PM_MRK_DATA_FROM_L2_NO_CONFLICT", ++ .pme_code = 0x1d140, ++ .pme_short_desc = "The processor's data cache was reloaded from local core's L2 without conflict due to a marked load", ++ .pme_long_desc = "The processor's data cache was reloaded from local core's L2 without conflict due to a marked load.", ++}, ++[ POWER8_PME_PM_MRK_DATA_FROM_L2_NO_CONFLICT_CYC ] = { ++ .pme_name = "PM_MRK_DATA_FROM_L2_NO_CONFLICT_CYC", ++ .pme_code = 0x4c120, ++ .pme_short_desc = "Duration in cycles to reload from local core's L2 without conflict due to a marked load", ++ .pme_long_desc = "Duration in cycles to reload from local core's L2 without conflict due to a marked load.", ++}, ++[ POWER8_PME_PM_MRK_DATA_FROM_L3 ] = { ++ .pme_name = "PM_MRK_DATA_FROM_L3", ++ .pme_code = 0x4d142, ++ .pme_short_desc = "The processor's data cache was reloaded from local core's L3 due to a marked load", ++ .pme_long_desc = "The processor's data cache was reloaded from local core's L3 due to a marked load.", ++}, ++[ POWER8_PME_PM_MRK_DATA_FROM_L3MISS_CYC ] = { ++ .pme_name = "PM_MRK_DATA_FROM_L3MISS_CYC", ++ .pme_code = 0x2d12e, ++ .pme_short_desc = "Duration in cycles to reload from a location other than the local core's L3 due to a marked load", ++ .pme_long_desc = "Duration in cycles to reload from a location other than the local core's L3 due to a marked load.", ++}, ++[ POWER8_PME_PM_MRK_DATA_FROM_L3_CYC ] = { ++ .pme_name = "PM_MRK_DATA_FROM_L3_CYC", ++ .pme_code = 0x2d122, ++ .pme_short_desc = "Duration in cycles to reload from local core's L3 due to a marked load", ++ .pme_long_desc = "Duration in cycles to reload from local core's L3 due to a marked load.", ++}, ++[ POWER8_PME_PM_MRK_DATA_FROM_L3_NO_CONFLICT ] = { ++ .pme_name = "PM_MRK_DATA_FROM_L3_NO_CONFLICT", ++ .pme_code = 0x1d144, ++ .pme_short_desc = "The processor's data cache was reloaded from local core's L3 without conflict due to a marked load", ++ .pme_long_desc = "The processor's data cache was reloaded from local core's L3 without conflict due to a marked load.", ++}, ++[ POWER8_PME_PM_MRK_DATA_FROM_L3_NO_CONFLICT_CYC ] = { ++ .pme_name = "PM_MRK_DATA_FROM_L3_NO_CONFLICT_CYC", ++ .pme_code = 0x4c124, ++ .pme_short_desc = "Duration in cycles to reload from local core's L3 without conflict due to a marked load", ++ .pme_long_desc = "Duration in cycles to reload from local core's L3 without conflict due to a marked load.", ++}, ++[ POWER8_PME_PM_MRK_DATA_FROM_LL4 ] = { ++ .pme_name = "PM_MRK_DATA_FROM_LL4", ++ .pme_code = 0x1d14c, ++ .pme_short_desc = "The processor's data cache was reloaded from the local chip's L4 cache due to a marked load", ++ .pme_long_desc = "The processor's data cache was reloaded from the local chip's L4 cache due to a marked load.", ++}, ++[ POWER8_PME_PM_MRK_DATA_FROM_LL4_CYC ] = { ++ .pme_name = "PM_MRK_DATA_FROM_LL4_CYC", ++ .pme_code = 0x4c12c, ++ .pme_short_desc = "Duration in cycles to reload from the local chip's L4 cache due to a marked load", ++ .pme_long_desc = "Duration in cycles to reload from the local chip's L4 cache due to a marked load.", ++}, ++[ POWER8_PME_PM_MRK_DATA_FROM_LMEM ] = { ++ .pme_name = "PM_MRK_DATA_FROM_LMEM", ++ .pme_code = 0x2d148, ++ .pme_short_desc = "The processor's data cache was reloaded from the local chip's Memory due to a marked load", ++ .pme_long_desc = "The processor's data cache was reloaded from the local chip's Memory due to a marked load.", ++}, ++[ POWER8_PME_PM_MRK_DATA_FROM_LMEM_CYC ] = { ++ .pme_name = "PM_MRK_DATA_FROM_LMEM_CYC", ++ .pme_code = 0x4d128, ++ .pme_short_desc = "Duration in cycles to reload from the local chip's Memory due to a marked load", ++ .pme_long_desc = "Duration in cycles to reload from the local chip's Memory due to a marked load.", ++}, ++[ POWER8_PME_PM_MRK_DATA_FROM_MEMORY ] = { ++ .pme_name = "PM_MRK_DATA_FROM_MEMORY", ++ .pme_code = 0x2d14c, ++ .pme_short_desc = "The processor's data cache was reloaded from a memory location including L4 from local remote or distant due to a marked load", ++ .pme_long_desc = "The processor's data cache was reloaded from a memory location including L4 from local remote or distant due to a marked load.", ++}, ++[ POWER8_PME_PM_MRK_DATA_FROM_MEMORY_CYC ] = { ++ .pme_name = "PM_MRK_DATA_FROM_MEMORY_CYC", ++ .pme_code = 0x4d12c, ++ .pme_short_desc = "Duration in cycles to reload from a memory location including L4 from local remote or distant due to a marked load", ++ .pme_long_desc = "Duration in cycles to reload from a memory location including L4 from local remote or distant due to a marked load.", ++}, ++[ POWER8_PME_PM_MRK_GRP_CMPL ] = { ++ .pme_name = "PM_MRK_GRP_CMPL", ++ .pme_code = 0x40130, ++ .pme_short_desc = "marked instruction finished (completed)", ++ .pme_long_desc = "marked instruction finished (completed).", ++}, ++[ POWER8_PME_PM_MRK_INST_DECODED ] = { ++ .pme_name = "PM_MRK_INST_DECODED", ++ .pme_code = 0x20130, ++ .pme_short_desc = "marked instruction decoded", ++ .pme_long_desc = "marked instruction decoded. Name from ISU?", ++}, ++[ POWER8_PME_PM_MRK_L2_RC_DISP ] = { ++ .pme_name = "PM_MRK_L2_RC_DISP", ++ .pme_code = 0x20114, ++ .pme_short_desc = "Marked Instruction RC dispatched in L2", ++ .pme_long_desc = "Marked Instruction RC dispatched in L2.", ++}, ++[ POWER8_PME_PM_MRK_LD_MISS_L1_CYC ] = { ++ .pme_name = "PM_MRK_LD_MISS_L1_CYC", ++ .pme_code = 0x4013e, ++ .pme_short_desc = "Marked ld latency", ++ .pme_long_desc = "Marked ld latency.", ++}, ++[ POWER8_PME_PM_MRK_STALL_CMPLU_CYC ] = { ++ .pme_name = "PM_MRK_STALL_CMPLU_CYC", ++ .pme_code = 0x3013e, ++ .pme_short_desc = "Marked Group completion Stall", ++ .pme_long_desc = "Marked Group Completion Stall cycles (use edge detect to count).", ++}, ++[ POWER8_PME_PM_NEST_REF_CLK ] = { ++ .pme_name = "PM_NEST_REF_CLK", ++ .pme_code = 0x3006e, ++ .pme_short_desc = "Nest reference clocks", ++ .pme_long_desc = "Nest reference clocks.", ++}, ++[ POWER8_PME_PM_PMC1_OVERFLOW ] = { ++ .pme_name = "PM_PMC1_OVERFLOW", ++ .pme_code = 0x20010, ++ .pme_short_desc = "Overflow from counter 1", ++ .pme_long_desc = "Overflow from counter 1.", ++}, ++[ POWER8_PME_PM_PMC2_OVERFLOW ] = { ++ .pme_name = "PM_PMC2_OVERFLOW", ++ .pme_code = 0x30010, ++ .pme_short_desc = "Overflow from counter 2", ++ .pme_long_desc = "Overflow from counter 2.", ++}, ++[ POWER8_PME_PM_PMC3_OVERFLOW ] = { ++ .pme_name = "PM_PMC3_OVERFLOW", ++ .pme_code = 0x40010, ++ .pme_short_desc = "Overflow from counter 3", ++ .pme_long_desc = "Overflow from counter 3.", ++}, ++[ POWER8_PME_PM_PMC4_OVERFLOW ] = { ++ .pme_name = "PM_PMC4_OVERFLOW", ++ .pme_code = 0x10010, ++ .pme_short_desc = "Overflow from counter 4", ++ .pme_long_desc = "Overflow from counter 4.", ++}, ++[ POWER8_PME_PM_PMC6_OVERFLOW ] = { ++ .pme_name = "PM_PMC6_OVERFLOW", ++ .pme_code = 0x30024, ++ .pme_short_desc = "Overflow from counter 6", ++ .pme_long_desc = "Overflow from counter 6.", ++}, ++[ POWER8_PME_PM_PPC_CMPL ] = { ++ .pme_name = "PM_PPC_CMPL", ++ .pme_code = 0x40002, ++ .pme_short_desc = "PPC Instructions Finished (completed)", ++ .pme_long_desc = "PPC Instructions Finished (completed).", ++}, ++[ POWER8_PME_PM_THRD_ALL_RUN_CYC ] = { ++ .pme_name = "PM_THRD_ALL_RUN_CYC", ++ .pme_code = 0x2000c, ++ .pme_short_desc = "All Threads in Run_cycles (was both threads in run_cycles)", ++ .pme_long_desc = "All Threads in Run_cycles (was both threads in run_cycles).", ++}, ++[ POWER8_PME_PM_THRESH_NOT_MET ] = { ++ .pme_name = "PM_THRESH_NOT_MET", ++ .pme_code = 0x4016e, ++ .pme_short_desc = "Threshold counter did not meet threshold", ++ .pme_long_desc = "Threshold counter did not meet threshold.", ++}, ++}; ++#endif +diff --git a/lib/pfmlib_common.c b/lib/pfmlib_common.c +index 7b11b46..71bddd9 100644 +--- a/lib/pfmlib_common.c ++++ b/lib/pfmlib_common.c +@@ -137,6 +137,7 @@ static pfmlib_pmu_t *pfmlib_pmus[]= + &power5p_support, + &power6_support, + &power7_support, ++ &power8_support, + &torrent_support, + #endif + +diff --git a/lib/pfmlib_power8.c b/lib/pfmlib_power8.c +new file mode 100644 +index 0000000..d274b59 +--- /dev/null ++++ b/lib/pfmlib_power8.c +@@ -0,0 +1,57 @@ ++/* ++ * pfmlib_power8.c : IBM Power8 support ++ * ++ * Copyright (C) IBM Corporation, 2013. All rights reserved. ++ * Contributed by Carl Love (carll@us.ibm.com) ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a copy ++ * of this software and associated documentation files (the "Software"), to deal ++ * in the Software without restriction, including without limitation the rights ++ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies ++ * of the Software, and to permit persons to whom the Software is furnished to do so, ++ * subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included in all ++ * copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, ++ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A ++ * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF ++ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE ++ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++ */ ++/* private headers */ ++#include "pfmlib_priv.h" ++#include "pfmlib_power_priv.h" ++#include "events/power8_events.h" ++ ++static int ++pfm_power8_detect(void* this) ++{ ++ if (__is_processor(PV_POWER8)) ++ return PFM_SUCCESS; ++ return PFM_ERR_NOTSUPP; ++} ++ ++pfmlib_pmu_t power8_support={ ++ .desc = "POWER8", ++ .name = "power8", ++ .pmu = PFM_PMU_POWER8, ++ .pme_count = LIBPFM_ARRAY_SIZE(power8_pe), ++ .type = PFM_PMU_TYPE_CORE, ++ .num_cntrs = 4, ++ .num_fixed_cntrs = 2, ++ .max_encoding = 1, ++ .pe = power8_pe, ++ .pmu_detect = pfm_power8_detect, ++ .get_event_encoding[PFM_OS_NONE] = pfm_gen_powerpc_get_encoding, ++ PFMLIB_ENCODE_PERF(pfm_gen_powerpc_get_perf_encoding), ++ PFMLIB_VALID_PERF_PATTRS(pfm_gen_powerpc_perf_validate_pattrs), ++ .get_event_first = pfm_gen_powerpc_get_event_first, ++ .get_event_next = pfm_gen_powerpc_get_event_next, ++ .event_is_valid = pfm_gen_powerpc_event_is_valid, ++ .validate_table = pfm_gen_powerpc_validate_table, ++ .get_event_info = pfm_gen_powerpc_get_event_info, ++ .get_event_attr_info = pfm_gen_powerpc_get_event_attr_info, ++}; +diff --git a/lib/pfmlib_power_priv.h b/lib/pfmlib_power_priv.h +index 2f66c22..2721771 100644 +--- a/lib/pfmlib_power_priv.h ++++ b/lib/pfmlib_power_priv.h +@@ -93,6 +93,7 @@ typedef struct { + #define PV_POWER7p 0x004a + #define PV_970MP 0x0044 + #define PV_970GX 0x0045 ++#define PV_POWER8 0x004b + + extern int pfm_gen_powerpc_get_event_info(void *this, int pidx, pfm_event_info_t *info); + extern int pfm_gen_powerpc_get_event_attr_info(void *this, int pidx, int umask_idx, pfm_event_attr_info_t *info); +diff --git a/lib/pfmlib_priv.h b/lib/pfmlib_priv.h +index d90f015..8e203d4 100644 +--- a/lib/pfmlib_priv.h ++++ b/lib/pfmlib_priv.h +@@ -264,6 +264,7 @@ extern pfmlib_pmu_t power5_support; + extern pfmlib_pmu_t power5p_support; + extern pfmlib_pmu_t power6_support; + extern pfmlib_pmu_t power7_support; ++extern pfmlib_pmu_t power8_support; + extern pfmlib_pmu_t torrent_support; + extern pfmlib_pmu_t sparc_support; + extern pfmlib_pmu_t sparc_ultra12_support; diff --git a/libpfm.spec b/libpfm.spec index 3dcf38f..2b1bf5a 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.4.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library to encode performance events for use by perf tool @@ -18,6 +18,7 @@ Group: System Environment/Libraries License: MIT URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz +Patch1: libpfm-power8.patch %if %{with python} BuildRequires: python-devel @@ -62,6 +63,8 @@ Python bindings for libpfm4 and perf_event_open system call. %prep %setup -q +%patch1 -p1 + %build %if %{with python} %global python_config CONFIG_PFMLIB_NOPYTHON=n @@ -108,6 +111,9 @@ make \ %endif %changelog +* Fri Jul 19 2013 William Cohen 4.4.0-2 +- Add IBM power 8 support. + * Mon Jun 17 2013 William Cohen 4.4.0-1 - Rebase on libpfm-4.4.0. From 29361e11c85a59977c6706458b2770983111cfbc Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 3 Aug 2013 01:42:55 -0500 Subject: [PATCH 12/94] - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 2b1bf5a..01567e1 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.4.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Library to encode performance events for use by perf tool @@ -111,6 +111,9 @@ make \ %endif %changelog +* Sat Aug 03 2013 Fedora Release Engineering - 4.4.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + * Fri Jul 19 2013 William Cohen 4.4.0-2 - Add IBM power 8 support. From 61289f645a21e4babd326ed302900ecae93f1d15 Mon Sep 17 00:00:00 2001 From: Lukas Berk Date: Tue, 19 Nov 2013 10:32:58 -0500 Subject: [PATCH 13/94] Automated weekly libpfm rawhide release: 3.199.g0b87987 --- .gitignore | 1 + libpfm.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 2347953..cd3ef52 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /libpfm-4.3.0.tar.gz /libpfm-4.4.0.tar.gz +/libpfm-4.4.0-3.199.g0b87987.tar.gz diff --git a/libpfm.spec b/libpfm.spec index 01567e1..a42997b 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,14 +10,14 @@ Name: libpfm Version: 4.4.0 -Release: 3%{?dist} +Release: 3.199.g0b87987%{?dist} Summary: Library to encode performance events for use by perf tool Group: System Environment/Libraries License: MIT URL: http://perfmon2.sourceforge.net/ -Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz +Source0: %{name}-%{version}-3.199.g0b87987.tar.gz Patch1: libpfm-power8.patch %if %{with python} @@ -111,6 +111,9 @@ make \ %endif %changelog +* Tue Nov 19 2013 Lukas Berk - 4.4.0-3.199.g0b87987 +- Automated weekly rawhide release + * Sat Aug 03 2013 Fedora Release Engineering - 4.4.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild diff --git a/sources b/sources index 6be9ae5..76c32ad 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -93b853c97a41044ef33c3071bdedb249 libpfm-4.4.0.tar.gz +1c977c8d4238b8105d35179f7289a566 libpfm-4.4.0-3.199.g0b87987.tar.gz From c227a98b2300d576048a28247b54a50d521ba14c Mon Sep 17 00:00:00 2001 From: Lukas Berk Date: Tue, 19 Nov 2013 10:53:34 -0500 Subject: [PATCH 14/94] Comment out patch applied upstream for rawhide release 3.199.g0b87987 --- libpfm.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index a42997b..9b95736 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -18,7 +18,7 @@ Group: System Environment/Libraries License: MIT URL: http://perfmon2.sourceforge.net/ Source0: %{name}-%{version}-3.199.g0b87987.tar.gz -Patch1: libpfm-power8.patch +#Patch1: libpfm-power8.patch %if %{with python} BuildRequires: python-devel @@ -112,7 +112,8 @@ make \ %changelog * Tue Nov 19 2013 Lukas Berk - 4.4.0-3.199.g0b87987 -- Automated weekly rawhide release +- Automated weekly rawhide Release +- Comment out Patch1 as applied upstream * Sat Aug 03 2013 Fedora Release Engineering - 4.4.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild From d31ad20f7ff3716ddb2dc5e0ece225a6d3c52a69 Mon Sep 17 00:00:00 2001 From: Lukas Berk Date: Tue, 19 Nov 2013 10:55:12 -0500 Subject: [PATCH 15/94] Comment out patch1 application for rawhide release 3.199.g0b87987 --- libpfm.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 9b95736..13e4f2c 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -63,7 +63,7 @@ Python bindings for libpfm4 and perf_event_open system call. %prep %setup -q -%patch1 -p1 +#%patch1 -p1 %build %if %{with python} From 5cf35974ab22073daa8bd20bd67c5dccdae24254 Mon Sep 17 00:00:00 2001 From: Lukas Berk Date: Mon, 25 Nov 2013 09:24:39 -0500 Subject: [PATCH 16/94] Automated weekly libpfm rawhide release: 3.200.g9df2031 --- .gitignore | 1 + libpfm.spec | 11 ++++++----- sources | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index cd3ef52..80cefff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /libpfm-4.3.0.tar.gz /libpfm-4.4.0.tar.gz /libpfm-4.4.0-3.199.g0b87987.tar.gz +/libpfm-4.4.0-3.200.g9df2031.tar.gz diff --git a/libpfm.spec b/libpfm.spec index 13e4f2c..4056509 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,15 +10,14 @@ Name: libpfm Version: 4.4.0 -Release: 3.199.g0b87987%{?dist} +Release: 3.200.g9df2031%{?dist} Summary: Library to encode performance events for use by perf tool Group: System Environment/Libraries License: MIT URL: http://perfmon2.sourceforge.net/ -Source0: %{name}-%{version}-3.199.g0b87987.tar.gz -#Patch1: libpfm-power8.patch +Source0: %{name}-%{version}-3.200.g9df2031.tar.gz %if %{with python} BuildRequires: python-devel @@ -63,8 +62,6 @@ Python bindings for libpfm4 and perf_event_open system call. %prep %setup -q -#%patch1 -p1 - %build %if %{with python} %global python_config CONFIG_PFMLIB_NOPYTHON=n @@ -111,6 +108,10 @@ make \ %endif %changelog +* Mon Nov 25 2013 Lukas Berk - 4.4.0-3.200.g9df2031 +- Automated weekly rawhide release +- Removed patch1 set + * Tue Nov 19 2013 Lukas Berk - 4.4.0-3.199.g0b87987 - Automated weekly rawhide Release - Comment out Patch1 as applied upstream diff --git a/sources b/sources index 76c32ad..1374dfc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -1c977c8d4238b8105d35179f7289a566 libpfm-4.4.0-3.199.g0b87987.tar.gz +f08a707f151575e5a934a8a6c68e7767 libpfm-4.4.0-3.200.g9df2031.tar.gz From bbc8d2ec411dfe773ed3522714797c9556f19c49 Mon Sep 17 00:00:00 2001 From: Lukas Berk Date: Wed, 15 Jan 2014 14:30:51 -0500 Subject: [PATCH 17/94] Automated weekly libpfm rawhide release: 5.217.gbca43a5 --- .gitignore | 1 + libpfm.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 80cefff..214a5db 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /libpfm-4.4.0.tar.gz /libpfm-4.4.0-3.199.g0b87987.tar.gz /libpfm-4.4.0-3.200.g9df2031.tar.gz +/libpfm-4.4.0-5.217.gbca43a5.tar.gz diff --git a/libpfm.spec b/libpfm.spec index 4056509..2261c97 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,14 +10,14 @@ Name: libpfm Version: 4.4.0 -Release: 3.200.g9df2031%{?dist} +Release: 5.217.gbca43a5%{?dist} Summary: Library to encode performance events for use by perf tool Group: System Environment/Libraries License: MIT URL: http://perfmon2.sourceforge.net/ -Source0: %{name}-%{version}-3.200.g9df2031.tar.gz +Source0: %{name}-%{version}-5.217.gbca43a5.tar.gz %if %{with python} BuildRequires: python-devel @@ -108,6 +108,9 @@ make \ %endif %changelog +* Wed Jan 15 2014 Lukas Berk - 4.4.0-5.217.gbca43a5 +- Automated weekly rawhide release + * Mon Nov 25 2013 Lukas Berk - 4.4.0-3.200.g9df2031 - Automated weekly rawhide release - Removed patch1 set diff --git a/sources b/sources index 1374dfc..a5c41db 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -f08a707f151575e5a934a8a6c68e7767 libpfm-4.4.0-3.200.g9df2031.tar.gz +2b01e4f1bdec4d0b0283f0b98c942a40 libpfm-4.4.0-5.217.gbca43a5.tar.gz From dbbf2a93552aae507bc01ce496137ac8303e047d Mon Sep 17 00:00:00 2001 From: William Cohen Date: Fri, 23 May 2014 13:38:02 -0400 Subject: [PATCH 18/94] Update to libpfm-4.5.0 --- .gitignore | 1 + libpfm-ac57.patch | 958 +++++++++++++++++++++++++++++++++++ libpfm-power8.patch | 1171 ------------------------------------------- libpfm.spec | 21 +- sources | 2 +- 5 files changed, 968 insertions(+), 1185 deletions(-) create mode 100644 libpfm-ac57.patch delete mode 100644 libpfm-power8.patch diff --git a/.gitignore b/.gitignore index 214a5db..07ce4c1 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /libpfm-4.4.0-3.199.g0b87987.tar.gz /libpfm-4.4.0-3.200.g9df2031.tar.gz /libpfm-4.4.0-5.217.gbca43a5.tar.gz +/libpfm-4.5.0.tar.gz diff --git a/libpfm-ac57.patch b/libpfm-ac57.patch new file mode 100644 index 0000000..56bd533 --- /dev/null +++ b/libpfm-ac57.patch @@ -0,0 +1,958 @@ +commit b1a3bf942376a3eaddc6f089c74bf5e322295822 +Author: Stephane Eranian +Date: Tue May 6 14:42:23 2014 +0200 + + Add ARM Cortex A57 support + + This patch adds support for ARM Cortex A57 processor + for both 64 and 32 bit modes (armv8). + + Based on Table 11-24 from the "Cortex A57 Technical Reference Manual" + + The validation tests for A57 in 64-bit mode is also added. + + Signed-off-by: Stephane Eranian + +diff --git a/config.mk b/config.mk +index 457d943..9553cbe 100644 +--- a/config.mk ++++ b/config.mk +@@ -66,6 +66,15 @@ endif + ifeq (armv7,$(findstring armv7,$(ARCH))) + override ARCH=arm + endif ++ifeq (armv7,$(findstring armv7,$(ARCH))) ++override ARCH=arm ++endif ++ifeq (aarch32,$(findstring aarch32,$(ARCH))) ++override ARCH=arm ++endif ++ifeq (armv8l,$(findstring armv8l,$(ARCH))) ++override ARCH=arm ++endif + ifeq (mips64,$(findstring mips64,$(ARCH))) + override ARCH=mips + endif +@@ -152,6 +161,14 @@ ifeq ($(ARCH),arm) + CONFIG_PFMLIB_ARCH_ARM=y + endif + ++ifeq ($(ARCH),aarch64) ++CONFIG_PFMLIB_ARCH_ARM64=y ++endif ++ ++ifeq ($(ARCH),arm64) ++CONFIG_PFMLIB_ARCH_ARM64=y ++endif ++ + ifeq ($(ARCH),s390x) + CONFIG_PFMLIB_ARCH_S390X=y + endif +diff --git a/include/perfmon/pfmlib.h b/include/perfmon/pfmlib.h +index dfdd471..b08df66 100644 +--- a/include/perfmon/pfmlib.h ++++ b/include/perfmon/pfmlib.h +@@ -237,6 +237,8 @@ typedef enum { + + PFM_PMU_S390X_CPUM_SF, /* s390x: CPU-M sampling facility */ + ++ PFM_PMU_ARM_CORTEX_A57, /* ARM Cortex A57 (ARMv8) */ ++ + /* MUST ADD NEW PMU MODELS HERE */ + + PFM_PMU_MAX /* end marker */ +diff --git a/lib/Makefile b/lib/Makefile +index 531167e..6ca3287 100644 +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -139,10 +139,21 @@ SRCS += pfmlib_arm_perf_event.c + endif + + INCARCH = $(INC_ARM) +-SRCS += pfmlib_arm.c pfmlib_arm_armv7_pmuv1.c pfmlib_arm_armv6.c ++SRCS += pfmlib_arm.c pfmlib_arm_armv7_pmuv1.c pfmlib_arm_armv6.c pfmlib_arm_armv8.c + CFLAGS += -DCONFIG_PFMLIB_ARCH_ARM + endif + ++ifeq ($(CONFIG_PFMLIB_ARCH_ARM64),y) ++ ++ifeq ($(SYS),Linux) ++SRCS += pfmlib_arm_perf_event.c ++endif ++ ++INCARCH = $(INC_ARM64) ++SRCS += pfmlib_arm.c pfmlib_arm_armv8.c ++CFLAGS += -DCONFIG_PFMLIB_ARCH_ARM64 ++endif ++ + ifeq ($(CONFIG_PFMLIB_ARCH_MIPS),y) + + ifeq ($(SYS),Linux) +@@ -272,6 +283,8 @@ INC_ARM=pfmlib_arm_priv.h \ + events/arm_cortex_a9_events.h \ + events/arm_cortex_a15_events.h + ++INC_ARM64=events/arm_cortex_a57_events.h ++ + INCDEP=$(INC_COMMON) $(INCARCH) + + all: $(TARGETS) +diff --git a/lib/events/arm_cortex_a57_events.h b/lib/events/arm_cortex_a57_events.h +new file mode 100644 +index 0000000..9d1d407 +--- /dev/null ++++ b/lib/events/arm_cortex_a57_events.h +@@ -0,0 +1,440 @@ ++/* ++ * Copyright (c) 2014 Google Inc. All rights reserved ++ * Contributed by Stephane Eranian ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a copy ++ * of this software and associated documentation files (the "Software"), to deal ++ * in the Software without restriction, including without limitation the rights ++ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies ++ * of the Software, and to permit persons to whom the Software is furnished to do so, ++ * subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included in all ++ * copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, ++ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A ++ * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF ++ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE ++ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++ * ++ * Cortex A57 r1p1 ++ * based on Table 11-24 from the "Cortex A57 Technical Reference Manual" ++ */ ++ ++static const arm_entry_t arm_cortex_a57_pe[]={ ++ {.name = "SW_INCR", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x00, ++ .desc = "Instruction architecturally executed (condition check pass) Software increment" ++ }, ++ {.name = "L1I_CACHE_REFILL", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x01, ++ .desc = "Level 1 instruction cache refill" ++ }, ++ {.name = "L1I_TLB_REFILL", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x02, ++ .desc = "Level 1 instruction TLB refill" ++ }, ++ {.name = "L1D_CACHE_REFILL", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x03, ++ .desc = "Level 1 data cache refill" ++ }, ++ {.name = "L1D_CACHE_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x04, ++ .desc = "Level 1 data cache access" ++ }, ++ {.name = "L1D_TLB_REFILL", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x05, ++ .desc = "Level 1 data TLB refill" ++ }, ++ ++ {.name = "INST_RETIRED", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x08, ++ .desc = "Instruction architecturally executed" ++ }, ++ {.name = "EXCEPTION_TAKEN", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x09, ++ .desc = "Exception taken" ++ }, ++ {.name = "EXCEPTION_RETURN", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x0a, ++ .desc = "Instruction architecturally executed (condition check pass) Exception return" ++ }, ++ {.name = "CID_WRITE_RETIRED", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x0b, ++ .desc = "Instruction architecturally executed (condition check pass) Write to CONTEXTIDR" ++ }, ++ ++ {.name = "BRANCH_MISPRED", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x10, ++ .desc = "Mispredicted or not predicted branch speculatively executed" ++ }, ++ {.name = "CPU_CYCLES", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x11, ++ .desc = "Cycles" ++ }, ++ {.name = "BRANCH_PRED", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x12, ++ .desc = "Predictable branch speculatively executed" ++ }, ++ {.name = "DATA_MEM_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x13, ++ .desc = "Data memory access" ++ }, ++ {.name = "L1I_CACHE_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x14, ++ .desc = "Level 1 instruction cache access" ++ }, ++ {.name = "L1D_CACHE_WB", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x15, ++ .desc = "Level 1 data cache WriteBack" ++ }, ++ {.name = "L2D_CACHE_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x16, ++ .desc = "Level 2 data cache access" ++ }, ++ {.name = "L2D_CACHE_REFILL", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x17, ++ .desc = "Level 2 data cache refill" ++ }, ++ {.name = "L2D_CACHE_WB", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x18, ++ .desc = "Level 2 data cache WriteBack" ++ }, ++ {.name = "BUS_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x19, ++ .desc = "Bus access" ++ }, ++ {.name = "LOCAL_MEMORY_ERROR", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x1a, ++ .desc = "Local memory error" ++ }, ++ {.name = "INST_SPEC_EXEC", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x1b, ++ .desc = "Instruction speculatively executed" ++ }, ++ {.name = "TTBR_WRITE_RETIRED", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x1c, ++ .desc = "Instruction architecturally executed (condition check pass) Write to translation table base" ++ }, ++ {.name = "BUS_CYCLES", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x1d, ++ .desc = "Bus cycle" ++ }, ++ {.name = "L1D_READ_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x40, ++ .desc = "Level 1 data cache read access" ++ }, ++ {.name = "L1D_WRITE_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x41, ++ .desc = "Level 1 data cache write access" ++ }, ++ {.name = "L1D_READ_REFILL", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x42, ++ .desc = "Level 1 data cache read refill" ++ }, ++ {.name = "L1D_WRITE_REFILL", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x43, ++ .desc = "Level 1 data cache write refill" ++ }, ++ {.name = "L1D_WB_VICTIM", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x46, ++ .desc = "Level 1 data cache writeback victim" ++ }, ++ {.name = "L1D_WB_CLEAN_COHERENCY", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x47, ++ .desc = "Level 1 data cache writeback cleaning and coherency" ++ }, ++ {.name = "L1D_INVALIDATE", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x48, ++ .desc = "Level 1 data cache invalidate" ++ }, ++ {.name = "L1D_TLB_READ_REFILL", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x4c, ++ .desc = "Level 1 data TLB read refill" ++ }, ++ {.name = "L1D_TLB_WRITE_REFILL", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x4d, ++ .desc = "Level 1 data TLB write refill" ++ }, ++ {.name = "L2D_READ_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x50, ++ .desc = "Level 2 data cache read access" ++ }, ++ {.name = "L2D_WRITE_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x51, ++ .desc = "Level 2 data cache write access" ++ }, ++ {.name = "L2D_READ_REFILL", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x52, ++ .desc = "Level 2 data cache read refill" ++ }, ++ {.name = "L2D_WRITE_REFILL", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x53, ++ .desc = "Level 2 data cache write refill" ++ }, ++ {.name = "L2D_WB_VICTIM", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x56, ++ .desc = "Level 2 data cache writeback victim" ++ }, ++ {.name = "L2D_WB_CLEAN_COHERENCY", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x57, ++ .desc = "Level 2 data cache writeback cleaning and coherency" ++ }, ++ {.name = "L2D_INVALIDATE", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x58, ++ .desc = "Level 2 data cache invalidate" ++ }, ++ {.name = "BUS_READ_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x60, ++ .desc = "Bus read access" ++ }, ++ {.name = "BUS_WRITE_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x61, ++ .desc = "Bus write access" ++ }, ++ {.name = "BUS_NORMAL_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x62, ++ .desc = "Bus normal access" ++ }, ++ {.name = "BUS_NOT_NORMAL_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x63, ++ .desc = "Bus not normal access" ++ }, ++ {.name = "BUS_NORMAL_ACCESS_2", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x64, ++ .desc = "Bus normal access" ++ }, ++ {.name = "BUS_PERIPH_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x65, ++ .desc = "Bus peripheral access" ++ }, ++ {.name = "DATA_MEM_READ_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x66, ++ .desc = "Data memory read access" ++ }, ++ {.name = "DATA_MEM_WRITE_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x67, ++ .desc = "Data memory write access" ++ }, ++ {.name = "UNALIGNED_READ_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x68, ++ .desc = "Unaligned read access" ++ }, ++ {.name = "UNALIGNED_WRITE_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x69, ++ .desc = "Unaligned read access" ++ }, ++ {.name = "UNALIGNED_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x6a, ++ .desc = "Unaligned access" ++ }, ++ {.name = "INST_SPEC_EXEC_LDREX", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x6c, ++ .desc = "LDREX exclusive instruction speculatively executed" ++ }, ++ {.name = "INST_SPEC_EXEC_STREX_PASS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x6d, ++ .desc = "STREX pass exclusive instruction speculatively executed" ++ }, ++ {.name = "INST_SPEC_EXEC_STREX_FAIL", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x6e, ++ .desc = "STREX fail exclusive instruction speculatively executed" ++ }, ++ {.name = "INST_SPEC_EXEC_LOAD", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x70, ++ .desc = "Load instruction speculatively executed" ++ }, ++ {.name = "INST_SPEC_EXEC_STORE", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x71, ++ .desc = "Store instruction speculatively executed" ++ }, ++ {.name = "INST_SPEC_EXEC_LOAD_STORE", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x72, ++ .desc = "Load or store instruction speculatively executed" ++ }, ++ {.name = "INST_SPEC_EXEC_INTEGER_INST", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x73, ++ .desc = "Integer data processing instruction speculatively executed" ++ }, ++ {.name = "INST_SPEC_EXEC_SIMD", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x74, ++ .desc = "Advanced SIMD instruction speculatively executed" ++ }, ++ {.name = "INST_SPEC_EXEC_VFP", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x75, ++ .desc = "VFP instruction speculatively executed" ++ }, ++ {.name = "INST_SPEC_EXEC_SOFT_PC", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x76, ++ .desc = "Software of the PC instruction speculatively executed" ++ }, ++ {.name = "BRANCH_SPEC_EXEC_IMM_BRANCH", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x78, ++ .desc = "Immediate branch speculatively executed" ++ }, ++ {.name = "BRANCH_SPEC_EXEC_RET", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x79, ++ .desc = "Return branch speculatively executed" ++ }, ++ {.name = "BRANCH_SPEC_EXEC_IND", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x7a, ++ .desc = "Indirect branch speculatively executed" ++ }, ++ {.name = "BARRIER_SPEC_EXEC_ISB", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x7c, ++ .desc = "ISB barrier speculatively executed" ++ }, ++ {.name = "BARRIER_SPEC_EXEC_DSB", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x7d, ++ .desc = "DSB barrier speculatively executed" ++ }, ++ {.name = "BARRIER_SPEC_EXEC_DMB", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x7e, ++ .desc = "DMB barrier speculatively executed" ++ }, ++ {.name = "EXCEPTION_UNDEF", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x81, ++ .desc = "Exception taken, other synchronous" ++ }, ++ {.name = "EXCEPTION_SVC", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x82, ++ .desc = "Exception taken, supervisor call" ++ }, ++ {.name = "EXCEPTION_PABORT", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x83, ++ .desc = "Exception taken, instruction abort" ++ }, ++ {.name = "EXCEPTION_DABORT", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x84, ++ .desc = "Exception taken, data abort or SError" ++ }, ++ {.name = "EXCEPTION_IRQ", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x86, ++ .desc = "Exception taken, irq" ++ }, ++ {.name = "EXCEPTION_FIQ", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x87, ++ .desc = "Exception taken, irq" ++ }, ++ {.name = "EXCEPTION_SMC", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x88, ++ .desc = "Exception taken, secure monitor call" ++ }, ++ {.name = "EXCEPTION_HVC", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x8a, ++ .desc = "Exception taken, hypervisor call" ++ }, ++ {.name = "EXCEPTION_TRAP_PABORT", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x8b, ++ .desc = "Exception taken, instruction abort not taken locally" ++ }, ++ {.name = "EXCEPTION_TRAP_DABORT", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x8c, ++ .desc = "Exception taken, data abort or SError not taken locally" ++ }, ++ {.name = "EXCEPTION_TRAP_OTHER", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x8d, ++ .desc = "Exception taken, other traps not taken locally" ++ }, ++ {.name = "EXCEPTION_TRAP_IRQ", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x8e, ++ .desc = "Exception taken, irq not taken locally" ++ }, ++ {.name = "EXCEPTION_TRAP_FIQ", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x8f, ++ .desc = "Exception taken, fiq not taken locally" ++ }, ++ {.name = "RC_LD_SPEC", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x90, ++ .desc = "Release consistency instruction speculatively executed (load-acquire)", ++ }, ++ {.name = "RC_ST_SPEC", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x91, ++ .desc = "Release consistency instruction speculatively executed (store-release)", ++ }, ++ /* END Cortex A47 specific events */ ++}; +diff --git a/lib/pfmlib_arm_armv8.c b/lib/pfmlib_arm_armv8.c +new file mode 100644 +index 0000000..880d566 +--- /dev/null ++++ b/lib/pfmlib_arm_armv8.c +@@ -0,0 +1,74 @@ ++/* ++ * pfmlib_arm_armv8.c : support for ARMv8 processors ++ * ++ * Copyright (c) 2014 Google Inc. All rights reserved ++ * Contributed by Stephane Eranian ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a copy ++ * of this software and associated documentation files (the "Software"), to deal ++ * in the Software without restriction, including without limitation the rights ++ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies ++ * of the Software, and to permit persons to whom the Software is furnished to do so, ++ * subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included in all ++ * copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, ++ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A ++ * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF ++ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE ++ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++ * ++ */ ++#include ++#include ++#include ++ ++/* private headers */ ++#include "pfmlib_priv.h" /* library private */ ++#include "pfmlib_arm_priv.h" ++ ++#include "events/arm_cortex_a57_events.h" /* event tables */ ++ ++static int ++pfm_arm_detect_cortex_a57(void *this) ++{ ++ int ret; ++ ++ ret = pfm_arm_detect(this); ++ if (ret != PFM_SUCCESS) ++ return PFM_ERR_NOTSUPP; ++ ++ if ((pfm_arm_cfg.implementer == 0x41) && /* ARM */ ++ (pfm_arm_cfg.part == 0xc00)) { /* Cortex A57 */ ++ return PFM_SUCCESS; ++ } ++ return PFM_ERR_NOTSUPP; ++} ++ ++/* ARM Cortex A57 support */ ++pfmlib_pmu_t arm_cortex_a57_support={ ++ .desc = "ARM Cortex A57", ++ .name = "arm_ac57", ++ .pmu = PFM_PMU_ARM_CORTEX_A57, ++ .pme_count = LIBPFM_ARRAY_SIZE(arm_cortex_a57_pe), ++ .type = PFM_PMU_TYPE_CORE, ++ .pe = arm_cortex_a57_pe, ++ ++ .pmu_detect = pfm_arm_detect_cortex_a57, ++ .max_encoding = 1, ++ .num_cntrs = 6, ++ ++ .get_event_encoding[PFM_OS_NONE] = pfm_arm_get_encoding, ++ PFMLIB_ENCODE_PERF(pfm_arm_get_perf_encoding), ++ .get_event_first = pfm_arm_get_event_first, ++ .get_event_next = pfm_arm_get_event_next, ++ .event_is_valid = pfm_arm_event_is_valid, ++ .validate_table = pfm_arm_validate_table, ++ .get_event_info = pfm_arm_get_event_info, ++ .get_event_attr_info = pfm_arm_get_event_attr_info, ++ PFMLIB_VALID_PERF_PATTRS(pfm_arm_perf_validate_pattrs), ++ .get_event_nattrs = pfm_arm_get_event_nattrs, ++}; +diff --git a/lib/pfmlib_arm_priv.h b/lib/pfmlib_arm_priv.h +index ef367b7..227508b 100644 +--- a/lib/pfmlib_arm_priv.h ++++ b/lib/pfmlib_arm_priv.h +@@ -86,6 +86,9 @@ extern int pfm_arm_get_perf_encoding(void *this, pfmlib_event_desc_t *e); + #define ARMV7_A15_ATTRS (_ARM_ATTR_K|_ARM_ATTR_U|_ARM_ATTR_HV) + #define ARMV7_A15_PLM (PFM_PLM0|PFM_PLM3|PFM_PLMH) + ++#define ARMV8_ATTRS (_ARM_ATTR_K|_ARM_ATTR_U|_ARM_ATTR_HV) ++#define ARMV8_PLM (PFM_PLM0|PFM_PLM3|PFM_PLMH) ++ + static inline int + arm_has_plm(void *this, pfmlib_event_desc_t *e) + { +diff --git a/lib/pfmlib_common.c b/lib/pfmlib_common.c +index 8e4b1a1..900d7de 100644 +--- a/lib/pfmlib_common.c ++++ b/lib/pfmlib_common.c +@@ -199,7 +199,12 @@ static pfmlib_pmu_t *pfmlib_pmus[]= + &arm_cortex_a15_support, + &arm_1176_support, + &arm_qcom_krait_support, ++ &arm_cortex_a57_support, + #endif ++#ifdef CONFIG_PFMLIB_ARCH_ARM64 ++ &arm_cortex_a57_support, ++#endif ++ + #ifdef CONFIG_PFMLIB_ARCH_S390X + &s390x_cpum_cf_support, + &s390x_cpum_sf_support, +diff --git a/lib/pfmlib_priv.h b/lib/pfmlib_priv.h +index 715c4b0..3031d3b 100644 +--- a/lib/pfmlib_priv.h ++++ b/lib/pfmlib_priv.h +@@ -332,6 +332,7 @@ extern pfmlib_pmu_t arm_cortex_a9_support; + extern pfmlib_pmu_t arm_cortex_a15_support; + extern pfmlib_pmu_t arm_1176_support; + extern pfmlib_pmu_t arm_qcom_krait_support; ++extern pfmlib_pmu_t arm_cortex_a57_support; + extern pfmlib_pmu_t mips_74k_support; + extern pfmlib_pmu_t s390x_cpum_cf_support; + extern pfmlib_pmu_t s390x_cpum_sf_support; +diff --git a/tests/Makefile b/tests/Makefile +index 7076fb7..7dd82c3 100644 +--- a/tests/Makefile ++++ b/tests/Makefile +@@ -39,6 +39,10 @@ ifeq ($(CONFIG_PFMLIB_ARCH_ARM),y) + SRCS += validate_arm.c + endif + ++ifeq ($(CONFIG_PFMLIB_ARCH_ARM64),y) ++SRCS += validate_arm64.c ++endif ++ + ifeq ($(CONFIG_PFMLIB_ARCH_POWERPC),y) + SRCS += validate_power.c + endif +diff --git a/tests/validate_arm.c b/tests/validate_arm.c +index fe97aa9..d6c0168 100644 +--- a/tests/validate_arm.c ++++ b/tests/validate_arm.c +@@ -159,6 +159,34 @@ static const test_event_t arm_test_events[]={ + .codes[0] = 0x480000ff, + .fstr = "qcom_krait::CPU_CYCLES:k=0:u=1:hv=0", + }, ++ { SRC_LINE, ++ .name = "arm_ac57::CPU_CYCLES", ++ .ret = PFM_SUCCESS, ++ .count = 1, ++ .codes[0] = 0x8000011, ++ .fstr = "arm_ac57::CPU_CYCLES:k=1:u=1:hv=0", ++ }, ++ { SRC_LINE, ++ .name = "arm_ac57::CPU_CYCLES:k", ++ .ret = PFM_SUCCESS, ++ .count = 1, ++ .codes[0] = 0x88000011, ++ .fstr = "arm_ac57::CPU_CYCLES:k=1:u=0:hv=0", ++ }, ++ { SRC_LINE, ++ .name = "arm_ac57::CPU_CYCLES:k:u", ++ .ret = PFM_SUCCESS, ++ .count = 1, ++ .codes[0] = 0x8000011, ++ .fstr = "arm_ac57::CPU_CYCLES:k=1:u=1:hv=0", ++ }, ++ { SRC_LINE, ++ .name = "arm_ac57::INST_RETIRED", ++ .ret = PFM_SUCCESS, ++ .count = 1, ++ .codes[0] = 0x8000008, ++ .fstr = "arm_ac57::INST_RETIRED:k=1:u=1:hv=0", ++ }, + }; + #define NUM_TEST_EVENTS (int)(sizeof(arm_test_events)/sizeof(test_event_t)) + +diff --git a/tests/validate_arm64.c b/tests/validate_arm64.c +new file mode 100644 +index 0000000..0f0174c +--- /dev/null ++++ b/tests/validate_arm64.c +@@ -0,0 +1,138 @@ ++/* ++ * validate_arm64.c - validate ARM64 event tables + encodings ++ * ++ * Copyright (c) 2014 Google, Inc ++ * Contributed by Stephane Eranian ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a copy ++ * of this software and associated documentation files (the "Software"), to deal ++ * in the Software without restriction, including without limitation the rights ++ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies ++ * of the Software, and to permit persons to whom the Software is furnished to do so, ++ * subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included in all ++ * copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, ++ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A ++ * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF ++ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE ++ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++ * ++ */ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++#define MAX_ENCODING 1 ++#define SRC_LINE .line = __LINE__ ++ ++typedef struct { ++ const char *name; ++ const char *fstr; ++ uint64_t codes[MAX_ENCODING]; ++ int ret, count, line; ++} test_event_t; ++ ++static const test_event_t arm64_test_events[]={ ++ { SRC_LINE, ++ .name = "arm_ac57::CPU_CYCLES", ++ .ret = PFM_SUCCESS, ++ .count = 1, ++ .codes[0] = 0x8000011, ++ .fstr = "arm_ac57::CPU_CYCLES:k=1:u=1:hv=0", ++ }, ++ { SRC_LINE, ++ .name = "arm_ac57::CPU_CYCLES:k", ++ .ret = PFM_SUCCESS, ++ .count = 1, ++ .codes[0] = 0x88000011, ++ .fstr = "arm_ac57::CPU_CYCLES:k=1:u=0:hv=0", ++ }, ++ { SRC_LINE, ++ .name = "arm_ac57::CPU_CYCLES:k:u", ++ .ret = PFM_SUCCESS, ++ .count = 1, ++ .codes[0] = 0x8000011, ++ .fstr = "arm_ac57::CPU_CYCLES:k=1:u=1:hv=0", ++ }, ++ { SRC_LINE, ++ .name = "arm_ac57::INST_RETIRED", ++ .ret = PFM_SUCCESS, ++ .count = 1, ++ .codes[0] = 0x8000008, ++ .fstr = "arm_ac57::INST_RETIRED:k=1:u=1:hv=0", ++ }, ++}; ++#define NUM_TEST_EVENTS (int)(sizeof(arm64_test_events)/sizeof(test_event_t)) ++ ++static int check_test_events(FILE *fp) ++{ ++ const test_event_t *e; ++ char *fstr; ++ uint64_t *codes; ++ int count, i, j; ++ int ret, errors = 0; ++ ++ for (i = 0, e = arm64_test_events; i < NUM_TEST_EVENTS; i++, e++) { ++ codes = NULL; ++ count = 0; ++ fstr = NULL; ++ ret = pfm_get_event_encoding(e->name, PFM_PLM0 | PFM_PLM3, &fstr, NULL, &codes, &count); ++ if (ret != e->ret) { ++ fprintf(fp,"Line %d, Event%d %s, ret=%s(%d) expected %s(%d)\n", e->line, i, e->name, pfm_strerror(ret), ret, pfm_strerror(e->ret), e->ret); ++ errors++; ++ } else { ++ if (ret != PFM_SUCCESS) { ++ if (fstr) { ++ fprintf(fp,"Line %d, Event%d %s, expected fstr NULL but it is not\n", e->line, i, e->name); ++ errors++; ++ } ++ if (count != 0) { ++ fprintf(fp,"Line %d, Event%d %s, expected count=0 instead of %d\n", e->line, i, e->name, count); ++ errors++; ++ } ++ if (codes) { ++ fprintf(fp,"Line %d, Event%d %s, expected codes[] NULL but it is not\n", e->line, i, e->name); ++ errors++; ++ } ++ } else { ++ if (count != e->count) { ++ fprintf(fp,"Line %d, Event%d %s, count=%d expected %d\n", e->line, i, e->name, count, e->count); ++ errors++; ++ } ++ for (j=0; j < count; j++) { ++ if (codes[j] != e->codes[j]) { ++ fprintf(fp,"Line %d, Event%d %s, codes[%d]=%#"PRIx64" expected %#"PRIx64"\n", e->line, i, e->name, j, codes[j], e->codes[j]); ++ errors++; ++ } ++ } ++ if (e->fstr && strcmp(fstr, e->fstr)) { ++ fprintf(fp,"Line %d, Event%d %s, fstr=%s expected %s\n", e->line, i, e->name, fstr, e->fstr); ++ errors++; ++ } ++ } ++ } ++ if (codes) ++ free(codes); ++ if (fstr) ++ free(fstr); ++ } ++ printf("\t %d ARM64 events: %d errors\n", i, errors); ++ return errors; ++} ++ ++int ++validate_arch(FILE *fp) ++{ ++ return check_test_events(fp); ++} +commit b95de18085dd74738752341e0004b3dd11f00a53 +Author: Stephane Eranian +Date: Mon May 12 14:15:57 2014 +0200 + + Add ARM Cortex A57 documentation + + Signed-off-by: Stephane Eranian + +diff --git a/docs/Makefile b/docs/Makefile +index ecf6769..9b79ec7 100644 +--- a/docs/Makefile ++++ b/docs/Makefile +@@ -76,7 +76,11 @@ endif + endif + + ifeq ($(CONFIG_PFMLIB_ARCH_ARM),y) +-ARCH_MAN += libpfm_arm_ac15.3 libpfm_arm_ac8.3 libpfm_arm_ac9.3 libpfm_arm_qcom_krait.3 ++ARCH_MAN += libpfm_arm_ac57.3 libpfm_arm_ac15.3 libpfm_arm_ac8.3 libpfm_arm_ac9.3 libpfm_arm_qcom_krait.3 ++endif ++ ++ifeq ($(CONFIG_PFMLIB_ARCH_ARM64),y) ++ARCH_MAN += libpfm_arm_ac57.3 + endif + + ifeq ($(CONFIG_PFMLIB_ARCH_MIPS),y) +diff --git a/docs/man3/libpfm_arm_ac57.3 b/docs/man3/libpfm_arm_ac57.3 +new file mode 100644 +index 0000000..c471ff1 +--- /dev/null ++++ b/docs/man3/libpfm_arm_ac57.3 +@@ -0,0 +1,36 @@ ++.TH LIBPFM 4 "May, 2014" "" "Linux Programmer's Manual" ++.SH NAME ++libpfm_arm_ac57 - support for Arm Cortex A57 PMU ++.SH SYNOPSIS ++.nf ++.B #include ++.sp ++.B PMU name: arm_ac57 ++.B PMU desc: ARM Cortex A57 ++.sp ++.SH DESCRIPTION ++The library supports the ARM Cortex A57 core PMU. ++ ++This PMU supports 6 counters and privilege levels filtering. ++It can operate in both 32 and 64 bit modes. ++ ++.SH MODIFIERS ++The following modifiers are supported on ARM Cortex A57: ++.TP ++.B u ++Measure at the user level. This corresponds to \fBPFM_PLM3\fR. ++This is a boolean modifier. ++.TP ++.B k ++Measure at the kernel level. This corresponds to \fBPFM_PLM0\fR. ++This is a boolean modifier. ++.TP ++.B hv ++Measure at the hypervisor level. This corresponds to \fBPFM_PLMH\fR. ++This is a boolean modifier. ++ ++.SH AUTHORS ++.nf ++Stephane Eranian ++.if ++.PP +commit 399aa947ca6f4c58acac8c6be52d2ad4e5268210 +Author: Stephane Eranian +Date: Fri May 16 15:42:40 2014 +0200 + + fix the ARM Cortex A57 detection + + This patch fixes the detection of ARM Cortex A57. + Was using the wrong part number. Correct number + is 0xD07. + + Signed-off-by: Stephane Eranian + +diff --git a/lib/pfmlib_arm_armv8.c b/lib/pfmlib_arm_armv8.c +index 880d566..4bc863b 100644 +--- a/lib/pfmlib_arm_armv8.c ++++ b/lib/pfmlib_arm_armv8.c +@@ -42,7 +42,7 @@ pfm_arm_detect_cortex_a57(void *this) + return PFM_ERR_NOTSUPP; + + if ((pfm_arm_cfg.implementer == 0x41) && /* ARM */ +- (pfm_arm_cfg.part == 0xc00)) { /* Cortex A57 */ ++ (pfm_arm_cfg.part == 0xd07)) { /* Cortex A57 */ + return PFM_SUCCESS; + } + return PFM_ERR_NOTSUPP; diff --git a/libpfm-power8.patch b/libpfm-power8.patch deleted file mode 100644 index 1177a5b..0000000 --- a/libpfm-power8.patch +++ /dev/null @@ -1,1171 +0,0 @@ -commit a637b532a405aa3c8c210f21f925e87c11bbeb3f -Author: Carl Love -Date: Mon Jun 17 22:11:44 2013 +0200 - - Add IBM Power 8 support - - This patch adds support for the Power 8 CPU events to the - libpfm4 library. - - Signed-off-by: Carl Love - -diff --git a/README b/README -index 74cc89f..905b768 100644 ---- a/README -+++ b/README -@@ -67,6 +67,7 @@ The library supports many PMUs. The current version can handle: - Power 5 - Power 6 - Power 7 -+ Power 8 - PPC970 - Torrent - System z (s390x) -diff --git a/include/perfmon/pfmlib.h b/include/perfmon/pfmlib.h -index 709048c..89b9fd8 100644 ---- a/include/perfmon/pfmlib.h -+++ b/include/perfmon/pfmlib.h -@@ -190,6 +190,8 @@ typedef enum { - PFM_PMU_INTEL_IVB_UNC_CB2, /* Intel IvyBridge C-box 2 uncore PMU */ - PFM_PMU_INTEL_IVB_UNC_CB3, /* Intel IvyBridge C-box 3 uncore PMU */ - -+ PFM_PMU_POWER8, /* IBM POWER8 */ -+ - /* MUST ADD NEW PMU MODELS HERE */ - - PFM_PMU_MAX /* end marker */ -diff --git a/lib/Makefile b/lib/Makefile -index a103927..98411b8 100644 ---- a/lib/Makefile -+++ b/lib/Makefile -@@ -95,7 +95,7 @@ SRCS += pfmlib_powerpc_perf_event.c - endif - - INCARCH = $(INC_POWERPC) --SRCS += pfmlib_powerpc.c pfmlib_power4.c pfmlib_ppc970.c pfmlib_power5.c pfmlib_power6.c pfmlib_power7.c pfmlib_torrent.c -+SRCS += pfmlib_powerpc.c pfmlib_power4.c pfmlib_ppc970.c pfmlib_power5.c pfmlib_power6.c pfmlib_power7.c pfmlib_torrent.c pfmlib_power8.c - CFLAGS += -DCONFIG_PFMLIB_ARCH_POWERPC - endif - -@@ -227,6 +227,7 @@ INC_POWERPC=events/ppc970_events.h \ - events/power5+_events.h \ - events/power6_events.h \ - events/power7_events.h \ -+ events/power8_events.h \ - events/torrent_events.h - - INC_S390X=pfmlib_s390x_priv.h \ -diff --git a/lib/events/power8_events.h b/lib/events/power8_events.h -new file mode 100644 -index 0000000..25945f3 ---- /dev/null -+++ b/lib/events/power8_events.h -@@ -0,0 +1,1009 @@ -+/****************************/ -+/* THIS IS OPEN SOURCE CODE */ -+/****************************/ -+ -+#ifndef __POWER8_EVENTS_H__ -+#define __POWER8_EVENTS_H__ -+ -+/* -+* File: power8_events.h -+* CVS: -+Author: Carl Love -+* carll.ibm.com -+* Mods: -+* -+* -+* (C) Copyright IBM Corporation, 2013. All Rights Reserved. -+* Contributed by -+* -+* Note: This code was automatically generated and should not be modified by -+* hand. -+* -+* Documentation on the PMU events will be published at: -+* http://www.power.org/documentation -+*/ -+ -+#define POWER8_PME_PM_1PLUS_PPC_CMPL 0 -+#define POWER8_PME_PM_1PLUS_PPC_DISP 1 -+#define POWER8_PME_PM_ANY_THRD_RUN_CYC 2 -+#define POWER8_PME_PM_BR_MPRED_CMPL 3 -+#define POWER8_PME_PM_BR_TAKEN_CMPL 4 -+#define POWER8_PME_PM_CYC 5 -+#define POWER8_PME_PM_DATA_FROM_L2MISS 6 -+#define POWER8_PME_PM_DATA_FROM_L3MISS 7 -+#define POWER8_PME_PM_DATA_FROM_MEM 8 -+#define POWER8_PME_PM_DTLB_MISS 9 -+#define POWER8_PME_PM_EXT_INT 10 -+#define POWER8_PME_PM_FLOP 11 -+#define POWER8_PME_PM_FLUSH 12 -+#define POWER8_PME_PM_GCT_NOSLOT_CYC 13 -+#define POWER8_PME_PM_IERAT_MISS 14 -+#define POWER8_PME_PM_INST_DISP 15 -+#define POWER8_PME_PM_INST_FROM_L3MISS 16 -+#define POWER8_PME_PM_ITLB_MISS 17 -+#define POWER8_PME_PM_L1_DCACHE_RELOAD_VALID 18 -+#define POWER8_PME_PM_L1_ICACHE_MISS 19 -+#define POWER8_PME_PM_LD_MISS_L1 20 -+#define POWER8_PME_PM_LSU_DERAT_MISS 21 -+#define POWER8_PME_PM_MRK_BR_MPRED_CMPL 22 -+#define POWER8_PME_PM_MRK_BR_TAKEN_CMPL 23 -+#define POWER8_PME_PM_MRK_DATA_FROM_L2MISS 24 -+#define POWER8_PME_PM_MRK_DATA_FROM_L3MISS 25 -+#define POWER8_PME_PM_MRK_DATA_FROM_MEM 26 -+#define POWER8_PME_PM_MRK_DERAT_MISS 27 -+#define POWER8_PME_PM_MRK_DTLB_MISS 28 -+#define POWER8_PME_PM_MRK_INST_CMPL 29 -+#define POWER8_PME_PM_MRK_INST_DISP 30 -+#define POWER8_PME_PM_MRK_INST_FROM_L3MISS 31 -+#define POWER8_PME_PM_MRK_L1_ICACHE_MISS 32 -+#define POWER8_PME_PM_MRK_L1_RELOAD_VALID 33 -+#define POWER8_PME_PM_MRK_LD_MISS_L1 34 -+#define POWER8_PME_PM_MRK_ST_CMPL 35 -+#define POWER8_PME_PM_RUN_CYC 36 -+#define POWER8_PME_PM_RUN_INST_CMPL 37 -+#define POWER8_PME_PM_RUN_PURR 38 -+#define POWER8_PME_PM_ST_FIN 39 -+#define POWER8_PME_PM_ST_MISS_L1 40 -+#define POWER8_PME_PM_TB_BIT_TRANS 41 -+#define POWER8_PME_PM_THRD_CONC_RUN_INST 42 -+#define POWER8_PME_PM_THRESH_EXC_1024 43 -+#define POWER8_PME_PM_THRESH_EXC_128 44 -+#define POWER8_PME_PM_THRESH_EXC_2048 45 -+#define POWER8_PME_PM_THRESH_EXC_256 46 -+#define POWER8_PME_PM_THRESH_EXC_32 47 -+#define POWER8_PME_PM_THRESH_EXC_4096 48 -+#define POWER8_PME_PM_THRESH_EXC_512 49 -+#define POWER8_PME_PM_THRESH_EXC_64 50 -+#define POWER8_PME_PM_THRESH_MET 51 -+#define POWER8_PME_PM_BR_2PATH 52 -+#define POWER8_PME_PM_BR_CMPL 53 -+#define POWER8_PME_PM_BR_MRK_2PATH 54 -+#define POWER8_PME_PM_CMPLU_STALL 55 -+#define POWER8_PME_PM_CMPLU_STALL_BRU 56 -+#define POWER8_PME_PM_CMPLU_STALL_BRU_CRU 57 -+#define POWER8_PME_PM_CMPLU_STALL_COQ_FULL 58 -+#define POWER8_PME_PM_CMPLU_STALL_DCACHE_MISS 59 -+#define POWER8_PME_PM_CMPLU_STALL_DMISS_L21_L31 60 -+#define POWER8_PME_PM_CMPLU_STALL_DMISS_L2L3 61 -+#define POWER8_PME_PM_CMPLU_STALL_DMISS_L2L3_CONFLICT 62 -+#define POWER8_PME_PM_CMPLU_STALL_DMISS_L3MISS 63 -+#define POWER8_PME_PM_CMPLU_STALL_DMISS_LMEM 64 -+#define POWER8_PME_PM_CMPLU_STALL_DMISS_REMOTE 65 -+#define POWER8_PME_PM_CMPLU_STALL_ERAT_MISS 66 -+#define POWER8_PME_PM_CMPLU_STALL_FLUSH 67 -+#define POWER8_PME_PM_CMPLU_STALL_FXLONG 68 -+#define POWER8_PME_PM_CMPLU_STALL_FXU 69 -+#define POWER8_PME_PM_CMPLU_STALL_HWSYNC 70 -+#define POWER8_PME_PM_CMPLU_STALL_LOAD_FINISH 71 -+#define POWER8_PME_PM_CMPLU_STALL_LSU 72 -+#define POWER8_PME_PM_CMPLU_STALL_LWSYNC 73 -+#define POWER8_PME_PM_CMPLU_STALL_MEM_ECC_DELAY 74 -+#define POWER8_PME_PM_CMPLU_STALL_NTCG_FLUSH 75 -+#define POWER8_PME_PM_CMPLU_STALL_OTHER_CMPL 76 -+#define POWER8_PME_PM_CMPLU_STALL_REJECT 77 -+#define POWER8_PME_PM_CMPLU_STALL_REJECT_LHS 78 -+#define POWER8_PME_PM_CMPLU_STALL_REJ_LMQ_FULL 79 -+#define POWER8_PME_PM_CMPLU_STALL_SCALAR 80 -+#define POWER8_PME_PM_CMPLU_STALL_SCALAR_LONG 81 -+#define POWER8_PME_PM_CMPLU_STALL_STORE 82 -+#define POWER8_PME_PM_CMPLU_STALL_ST_FWD 83 -+#define POWER8_PME_PM_CMPLU_STALL_THRD 84 -+#define POWER8_PME_PM_CMPLU_STALL_VECTOR 85 -+#define POWER8_PME_PM_CMPLU_STALL_VECTOR_LONG 86 -+#define POWER8_PME_PM_CMPLU_STALL_VSU 87 -+#define POWER8_PME_PM_DATA_FROM_L2 88 -+#define POWER8_PME_PM_DATA_FROM_L2_NO_CONFLICT 89 -+#define POWER8_PME_PM_DATA_FROM_L3 90 -+#define POWER8_PME_PM_DATA_FROM_L3MISS_MOD 91 -+#define POWER8_PME_PM_DATA_FROM_L3_NO_CONFLICT 92 -+#define POWER8_PME_PM_DATA_FROM_LMEM 93 -+#define POWER8_PME_PM_DATA_FROM_MEMORY 94 -+#define POWER8_PME_PM_DC_PREF_STREAM_STRIDED_CONF 95 -+#define POWER8_PME_PM_GCT_NOSLOT_BR_MPRED 96 -+#define POWER8_PME_PM_GCT_NOSLOT_BR_MPRED_ICMISS 97 -+#define POWER8_PME_PM_GCT_NOSLOT_DISP_HELD_ISSQ 98 -+#define POWER8_PME_PM_GCT_NOSLOT_DISP_HELD_OTHER 99 -+#define POWER8_PME_PM_GCT_NOSLOT_DISP_HELD_SRQ 100 -+#define POWER8_PME_PM_GCT_NOSLOT_IC_L3MISS 101 -+#define POWER8_PME_PM_GCT_NOSLOT_IC_MISS 102 -+#define POWER8_PME_PM_GRP_DISP 103 -+#define POWER8_PME_PM_GRP_MRK 104 -+#define POWER8_PME_PM_HV_CYC 105 -+#define POWER8_PME_PM_INST_CMPL 106 -+#define POWER8_PME_PM_IOPS_CMPL 107 -+#define POWER8_PME_PM_LD_CMPL 108 -+#define POWER8_PME_PM_LD_L3MISS_PEND_CYC 109 -+#define POWER8_PME_PM_MRK_DATA_FROM_L2 110 -+#define POWER8_PME_PM_MRK_DATA_FROM_L2MISS_CYC 111 -+#define POWER8_PME_PM_MRK_DATA_FROM_L2_CYC 112 -+#define POWER8_PME_PM_MRK_DATA_FROM_L2_NO_CONFLICT 113 -+#define POWER8_PME_PM_MRK_DATA_FROM_L2_NO_CONFLICT_CYC 114 -+#define POWER8_PME_PM_MRK_DATA_FROM_L3 115 -+#define POWER8_PME_PM_MRK_DATA_FROM_L3MISS_CYC 116 -+#define POWER8_PME_PM_MRK_DATA_FROM_L3_CYC 117 -+#define POWER8_PME_PM_MRK_DATA_FROM_L3_NO_CONFLICT 118 -+#define POWER8_PME_PM_MRK_DATA_FROM_L3_NO_CONFLICT_CYC 119 -+#define POWER8_PME_PM_MRK_DATA_FROM_LL4 120 -+#define POWER8_PME_PM_MRK_DATA_FROM_LL4_CYC 121 -+#define POWER8_PME_PM_MRK_DATA_FROM_LMEM 122 -+#define POWER8_PME_PM_MRK_DATA_FROM_LMEM_CYC 123 -+#define POWER8_PME_PM_MRK_DATA_FROM_MEMORY 124 -+#define POWER8_PME_PM_MRK_DATA_FROM_MEMORY_CYC 125 -+#define POWER8_PME_PM_MRK_GRP_CMPL 126 -+#define POWER8_PME_PM_MRK_INST_DECODED 127 -+#define POWER8_PME_PM_MRK_L2_RC_DISP 128 -+#define POWER8_PME_PM_MRK_LD_MISS_L1_CYC 129 -+#define POWER8_PME_PM_MRK_STALL_CMPLU_CYC 130 -+#define POWER8_PME_PM_NEST_REF_CLK 131 -+#define POWER8_PME_PM_PMC1_OVERFLOW 132 -+#define POWER8_PME_PM_PMC2_OVERFLOW 133 -+#define POWER8_PME_PM_PMC3_OVERFLOW 134 -+#define POWER8_PME_PM_PMC4_OVERFLOW 135 -+#define POWER8_PME_PM_PMC6_OVERFLOW 136 -+#define POWER8_PME_PM_PPC_CMPL 137 -+#define POWER8_PME_PM_THRD_ALL_RUN_CYC 138 -+#define POWER8_PME_PM_THRESH_NOT_MET 139 -+ -+static const pme_power_entry_t power8_pe[] = { -+[ POWER8_PME_PM_1PLUS_PPC_CMPL ] = { -+ .pme_name = "PM_1PLUS_PPC_CMPL", -+ .pme_code = 0x100f2, -+ .pme_short_desc = "one or more ppc instructions completed", -+ .pme_long_desc = "one or more ppc instructions finished", -+}, -+[ POWER8_PME_PM_1PLUS_PPC_DISP ] = { -+ .pme_name = "PM_1PLUS_PPC_DISP", -+ .pme_code = 0x400f2, -+ .pme_short_desc = "Cycles at least one Instr Dispatched", -+ .pme_long_desc = "Cycles at least one Instr Dispatched", -+}, -+[ POWER8_PME_PM_ANY_THRD_RUN_CYC ] = { -+ .pme_name = "PM_ANY_THRD_RUN_CYC", -+ .pme_code = 0x100fa, -+ .pme_short_desc = "Any thread in run_cycles (was one thread in run_cycles)", -+ .pme_long_desc = "One of threads in run_cycles", -+}, -+[ POWER8_PME_PM_BR_MPRED_CMPL ] = { -+ .pme_name = "PM_BR_MPRED_CMPL", -+ .pme_code = 0x400f6, -+ .pme_short_desc = "Number of Branch Mispredicts", -+ .pme_long_desc = "Number of Branch Mispredicts", -+}, -+[ POWER8_PME_PM_BR_TAKEN_CMPL ] = { -+ .pme_name = "PM_BR_TAKEN_CMPL", -+ .pme_code = 0x200fa, -+ .pme_short_desc = "Branch Taken", -+ .pme_long_desc = "New event for Branch Taken", -+}, -+[ POWER8_PME_PM_CYC ] = { -+ .pme_name = "PM_CYC", -+ .pme_code = 0x100f0, -+ .pme_short_desc = "Cycles", -+ .pme_long_desc = "Cycles", -+}, -+[ POWER8_PME_PM_DATA_FROM_L2MISS ] = { -+ .pme_name = "PM_DATA_FROM_L2MISS", -+ .pme_code = 0x200fe, -+ .pme_short_desc = "Demand LD - L2 Miss (not L2 hit)", -+ .pme_long_desc = "Demand LD - L2 Miss (not L2 hit)", -+}, -+[ POWER8_PME_PM_DATA_FROM_L3MISS ] = { -+ .pme_name = "PM_DATA_FROM_L3MISS", -+ .pme_code = 0x300fe, -+ .pme_short_desc = "Demand LD - L3 Miss (not L2 hit and not L3 hit)", -+ .pme_long_desc = "Demand LD - L3 Miss (not L2 hit and not L3 hit)", -+}, -+[ POWER8_PME_PM_DATA_FROM_MEM ] = { -+ .pme_name = "PM_DATA_FROM_MEM", -+ .pme_code = 0x400fe, -+ .pme_short_desc = "Data cache reload from memory (including L4)", -+ .pme_long_desc = "data from Memory", -+}, -+[ POWER8_PME_PM_DTLB_MISS ] = { -+ .pme_name = "PM_DTLB_MISS", -+ .pme_code = 0x300fc, -+ .pme_short_desc = "Data PTEG Reloaded (DTLB Miss)", -+ .pme_long_desc = "Data PTEG reload", -+}, -+[ POWER8_PME_PM_EXT_INT ] = { -+ .pme_name = "PM_EXT_INT", -+ .pme_code = 0x200f8, -+ .pme_short_desc = "external interrupt", -+ .pme_long_desc = "external interrupt", -+}, -+[ POWER8_PME_PM_FLOP ] = { -+ .pme_name = "PM_FLOP", -+ .pme_code = 0x100f4, -+ .pme_short_desc = "Floating Point Operations Finished", -+ .pme_long_desc = "Floating Point Operations Finished", -+}, -+[ POWER8_PME_PM_FLUSH ] = { -+ .pme_name = "PM_FLUSH", -+ .pme_code = 0x400f8, -+ .pme_short_desc = "Flush (any type)", -+ .pme_long_desc = "Flush (any type)", -+}, -+[ POWER8_PME_PM_GCT_NOSLOT_CYC ] = { -+ .pme_name = "PM_GCT_NOSLOT_CYC", -+ .pme_code = 0x100f8, -+ .pme_short_desc = "Pipeline empty (No itags assigned , no GCT slots used)", -+ .pme_long_desc = "No itags assigned", -+}, -+[ POWER8_PME_PM_IERAT_MISS ] = { -+ .pme_name = "PM_IERAT_MISS", -+ .pme_code = 0x100f6, -+ .pme_short_desc = "IERAT Reloaded (Miss)", -+ .pme_long_desc = "Cycles Instruction ERAT was reloaded", -+}, -+[ POWER8_PME_PM_INST_DISP ] = { -+ .pme_name = "PM_INST_DISP", -+ .pme_code = 0x200f2, -+ .pme_short_desc = "Number of PPC Dispatched", -+ .pme_long_desc = "Number of PPC Dispatched", -+}, -+[ POWER8_PME_PM_INST_FROM_L3MISS ] = { -+ .pme_name = "PM_INST_FROM_L3MISS", -+ .pme_code = 0x300fa, -+ .pme_short_desc = "Inst from L3 miss", -+ .pme_long_desc = "A Instruction cacheline request resolved from a location that was beyond the local L3 cache", -+}, -+[ POWER8_PME_PM_ITLB_MISS ] = { -+ .pme_name = "PM_ITLB_MISS", -+ .pme_code = 0x400fc, -+ .pme_short_desc = "ITLB Reloaded", -+ .pme_long_desc = "ITLB Reloaded (always zero on POWER6)", -+}, -+[ POWER8_PME_PM_L1_DCACHE_RELOAD_VALID ] = { -+ .pme_name = "PM_L1_DCACHE_RELOAD_VALID", -+ .pme_code = 0x300f6, -+ .pme_short_desc = "DL1 reloaded due to Demand Load", -+ .pme_long_desc = "DL1 reloaded due to Demand Load", -+}, -+[ POWER8_PME_PM_L1_ICACHE_MISS ] = { -+ .pme_name = "PM_L1_ICACHE_MISS", -+ .pme_code = 0x200fc, -+ .pme_short_desc = "Demand iCache Miss", -+ .pme_long_desc = "Demand iCache Miss", -+}, -+[ POWER8_PME_PM_LD_MISS_L1 ] = { -+ .pme_name = "PM_LD_MISS_L1", -+ .pme_code = 0x400f0, -+ .pme_short_desc = "Load Missed L1", -+ .pme_long_desc = "Load Missed L1", -+}, -+[ POWER8_PME_PM_LSU_DERAT_MISS ] = { -+ .pme_name = "PM_LSU_DERAT_MISS", -+ .pme_code = 0x200f6, -+ .pme_short_desc = "DERAT Reloaded (Miss)", -+ .pme_long_desc = "DERAT Reloaded due to a DERAT miss", -+}, -+[ POWER8_PME_PM_MRK_BR_MPRED_CMPL ] = { -+ .pme_name = "PM_MRK_BR_MPRED_CMPL", -+ .pme_code = 0x300e4, -+ .pme_short_desc = "Marked Branch Mispredicted", -+ .pme_long_desc = "Marked Branch Mispredicted", -+}, -+[ POWER8_PME_PM_MRK_BR_TAKEN_CMPL ] = { -+ .pme_name = "PM_MRK_BR_TAKEN_CMPL", -+ .pme_code = 0x100e2, -+ .pme_short_desc = "Marked Branch Taken", -+ .pme_long_desc = "Marked Branch Taken completed", -+}, -+[ POWER8_PME_PM_MRK_DATA_FROM_L2MISS ] = { -+ .pme_name = "PM_MRK_DATA_FROM_L2MISS", -+ .pme_code = 0x400e8, -+ .pme_short_desc = "Data cache reload L2 miss", -+ .pme_long_desc = "sampled load resolved beyond L2", -+}, -+[ POWER8_PME_PM_MRK_DATA_FROM_L3MISS ] = { -+ .pme_name = "PM_MRK_DATA_FROM_L3MISS", -+ .pme_code = 0x200e4, -+ .pme_short_desc = "The processor's data cache was reloaded from a location other than the local core's L3 due to a marked load", -+ .pme_long_desc = "sampled load resolved beyond L3", -+}, -+[ POWER8_PME_PM_MRK_DATA_FROM_MEM ] = { -+ .pme_name = "PM_MRK_DATA_FROM_MEM", -+ .pme_code = 0x200e0, -+ .pme_short_desc = "The processor's data cache was reloaded from a memory location including L4 from local remote or distant due to a marked load", -+ .pme_long_desc = "sampled load resolved from memory", -+}, -+[ POWER8_PME_PM_MRK_DERAT_MISS ] = { -+ .pme_name = "PM_MRK_DERAT_MISS", -+ .pme_code = 0x300e6, -+ .pme_short_desc = "Erat Miss (TLB Access) All page sizes", -+ .pme_long_desc = "Erat Miss (TLB Access) All page sizes", -+}, -+[ POWER8_PME_PM_MRK_DTLB_MISS ] = { -+ .pme_name = "PM_MRK_DTLB_MISS", -+ .pme_code = 0x400e4, -+ .pme_short_desc = "Marked dtlb miss", -+ .pme_long_desc = "sampled Instruction dtlb miss", -+}, -+[ POWER8_PME_PM_MRK_INST_CMPL ] = { -+ .pme_name = "PM_MRK_INST_CMPL", -+ .pme_code = 0x400e0, -+ .pme_short_desc = "marked instruction completed", -+ .pme_long_desc = "Marked group complete", -+}, -+[ POWER8_PME_PM_MRK_INST_DISP ] = { -+ .pme_name = "PM_MRK_INST_DISP", -+ .pme_code = 0x100e0, -+ .pme_short_desc = "Marked Instruction dispatched", -+ .pme_long_desc = "The thread has dispatched a randomly sampled marked instruction", -+}, -+[ POWER8_PME_PM_MRK_INST_FROM_L3MISS ] = { -+ .pme_name = "PM_MRK_INST_FROM_L3MISS", -+ .pme_code = 0x400e6, -+ .pme_short_desc = "sampled instruction missed icache and came from beyond L3 A Instruction cacheline request for a marked/sampled instruction resolved from a location that was beyond the local L3 cache", -+ .pme_long_desc = "sampled instruction missed icache and came from beyond L3 A Instruction cacheline request for a marked/sampled instruction resolved from a location that was beyond the local L3 cache", -+}, -+[ POWER8_PME_PM_MRK_L1_ICACHE_MISS ] = { -+ .pme_name = "PM_MRK_L1_ICACHE_MISS", -+ .pme_code = 0x100e4, -+ .pme_short_desc = "Marked L1 Icache Miss", -+ .pme_long_desc = "sampled Instruction suffered an icache Miss", -+}, -+[ POWER8_PME_PM_MRK_L1_RELOAD_VALID ] = { -+ .pme_name = "PM_MRK_L1_RELOAD_VALID", -+ .pme_code = 0x100ea, -+ .pme_short_desc = "Marked demand reload", -+ .pme_long_desc = "Sampled Instruction had a data reload", -+}, -+[ POWER8_PME_PM_MRK_LD_MISS_L1 ] = { -+ .pme_name = "PM_MRK_LD_MISS_L1", -+ .pme_code = 0x200e2, -+ .pme_short_desc = "Marked DL1 Demand Miss counted at exec time", -+ .pme_long_desc = "Marked DL1 Demand Miss", -+}, -+[ POWER8_PME_PM_MRK_ST_CMPL ] = { -+ .pme_name = "PM_MRK_ST_CMPL", -+ .pme_code = 0x300e2, -+ .pme_short_desc = "Marked store completed", -+ .pme_long_desc = "marked store completed and sent to nest", -+}, -+[ POWER8_PME_PM_RUN_CYC ] = { -+ .pme_name = "PM_RUN_CYC", -+ .pme_code = 0x600f4, -+ .pme_short_desc = "Run_cycles", -+ .pme_long_desc = "Run_cycles", -+}, -+[ POWER8_PME_PM_RUN_INST_CMPL ] = { -+ .pme_name = "PM_RUN_INST_CMPL", -+ .pme_code = 0x500fa, -+ .pme_short_desc = "Run_Instructions", -+ .pme_long_desc = "Run_Instructions", -+}, -+[ POWER8_PME_PM_RUN_PURR ] = { -+ .pme_name = "PM_RUN_PURR", -+ .pme_code = 0x400f4, -+ .pme_short_desc = "Run_PURR", -+ .pme_long_desc = "Run_PURR", -+}, -+[ POWER8_PME_PM_ST_FIN ] = { -+ .pme_name = "PM_ST_FIN", -+ .pme_code = 0x200f0, -+ .pme_short_desc = "Store Instructions Finished (store sent to nest)", -+ .pme_long_desc = "Store Instructions Finished", -+}, -+[ POWER8_PME_PM_ST_MISS_L1 ] = { -+ .pme_name = "PM_ST_MISS_L1", -+ .pme_code = 0x300f0, -+ .pme_short_desc = "Store Missed L1", -+ .pme_long_desc = "Store Missed L1", -+}, -+[ POWER8_PME_PM_TB_BIT_TRANS ] = { -+ .pme_name = "PM_TB_BIT_TRANS", -+ .pme_code = 0x300f8, -+ .pme_short_desc = "timebase event", -+ .pme_long_desc = "timebase event", -+}, -+[ POWER8_PME_PM_THRD_CONC_RUN_INST ] = { -+ .pme_name = "PM_THRD_CONC_RUN_INST", -+ .pme_code = 0x300f4, -+ .pme_short_desc = "Concurrent Run Instructions", -+ .pme_long_desc = "PPC Instructions Finished when both threads in run_cycles", -+}, -+[ POWER8_PME_PM_THRESH_EXC_1024 ] = { -+ .pme_name = "PM_THRESH_EXC_1024", -+ .pme_code = 0x300ea, -+ .pme_short_desc = "Threshold counter exceeded a value of 1024 Architecture provides a thresholding counter in MMCRA, it has a start and stop events to configure and a programmable threshold, this event increments when the threshold exceeded a count of 1024", -+ .pme_long_desc = "Threshold counter exceeded a value of 1024 Architecture provides a thresholding counter in MMCRA, it has a start and stop events to configure and a programmable threshold, this event increments when the threshold exceeded a count of 1024", -+}, -+[ POWER8_PME_PM_THRESH_EXC_128 ] = { -+ .pme_name = "PM_THRESH_EXC_128", -+ .pme_code = 0x400ea, -+ .pme_short_desc = "Threshold counter exceeded a value of 128", -+ .pme_long_desc = "Architecture provides a thresholding counter in MMCRA, it has a start and stop events to configure and a programmable threshold, this event increments when the threshold exceeded a count of 128", -+}, -+[ POWER8_PME_PM_THRESH_EXC_2048 ] = { -+ .pme_name = "PM_THRESH_EXC_2048", -+ .pme_code = 0x400ec, -+ .pme_short_desc = "Threshold counter exceeded a value of 2048", -+ .pme_long_desc = "Architecture provides a thresholding counter in MMCRA, it has a start and stop events to configure and a programmable threshold, this event increments when the threshold exceeded a count of 2048", -+}, -+[ POWER8_PME_PM_THRESH_EXC_256 ] = { -+ .pme_name = "PM_THRESH_EXC_256", -+ .pme_code = 0x100e8, -+ .pme_short_desc = "Threshold counter exceed a count of 256", -+ .pme_long_desc = "Architecture provides a thresholding counter in MMCRA, it has a start and stop events to configure and a programmable threshold, this event increments when the threshold exceeded a count of 256", -+}, -+[ POWER8_PME_PM_THRESH_EXC_32 ] = { -+ .pme_name = "PM_THRESH_EXC_32", -+ .pme_code = 0x200e6, -+ .pme_short_desc = "Threshold counter exceeded a value of 32", -+ .pme_long_desc = "Architecture provides a thresholding counter in MMCRA, it has a start and stop events to configure and a programmable threshold, this event increments when the threshold exceeded a count of 32", -+}, -+[ POWER8_PME_PM_THRESH_EXC_4096 ] = { -+ .pme_name = "PM_THRESH_EXC_4096", -+ .pme_code = 0x100e6, -+ .pme_short_desc = "Threshold counter exceed a count of 4096", -+ .pme_long_desc = "Architecture provides a thresholding counter in MMCRA, it has a start and stop events to configure and a programmable threshold, this event increments when the threshold exceeded a count of 4096", -+}, -+[ POWER8_PME_PM_THRESH_EXC_512 ] = { -+ .pme_name = "PM_THRESH_EXC_512", -+ .pme_code = 0x200e8, -+ .pme_short_desc = "Threshold counter exceeded a value of 512 Architecture provides a thresholding counter in MMCRA, it has a start and stop events to configure and a programmable threshold, this event increments when the threshold exceeded a count of 512", -+ .pme_long_desc = "Threshold counter exceeded a value of 512 Architecture provides a thresholding counter in MMCRA, it has a start and stop events to configure and a programmable threshold, this event increments when the threshold exceeded a count of 512", -+}, -+[ POWER8_PME_PM_THRESH_EXC_64 ] = { -+ .pme_name = "PM_THRESH_EXC_64", -+ .pme_code = 0x300e8, -+ .pme_short_desc = "Threshold counter exceeded a value of 64 Architecture provides a thresholding counter in MMCRA, it has a start and stop events to configure and a programmable threshold, this event increments when the threshold exceeded a count of 64", -+ .pme_long_desc = "Threshold counter exceeded a value of 64 Architecture provides a thresholding counter in MMCRA, it has a start and stop events to configure and a programmable threshold, this event increments when the threshold exceeded a count of 64", -+}, -+[ POWER8_PME_PM_THRESH_MET ] = { -+ .pme_name = "PM_THRESH_MET", -+ .pme_code = 0x100ec, -+ .pme_short_desc = "threshold exceeded", -+ .pme_long_desc = "Threshold exceeded", -+}, -+[ POWER8_PME_PM_BR_2PATH ] = { -+ .pme_name = "PM_BR_2PATH", -+ .pme_code = 0x40036, -+ .pme_short_desc = "two path branch", -+ .pme_long_desc = "two path branch.", -+}, -+[ POWER8_PME_PM_BR_CMPL ] = { -+ .pme_name = "PM_BR_CMPL", -+ .pme_code = 0x40060, -+ .pme_short_desc = "Branch Instruction completed", -+ .pme_long_desc = "Branch Instruction completed.", -+}, -+[ POWER8_PME_PM_BR_MRK_2PATH ] = { -+ .pme_name = "PM_BR_MRK_2PATH", -+ .pme_code = 0x40138, -+ .pme_short_desc = "marked two path branch", -+ .pme_long_desc = "marked two path branch.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL ] = { -+ .pme_name = "PM_CMPLU_STALL", -+ .pme_code = 0x1e054, -+ .pme_short_desc = "Completion stall", -+ .pme_long_desc = "Completion stall.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_BRU ] = { -+ .pme_name = "PM_CMPLU_STALL_BRU", -+ .pme_code = 0x4d018, -+ .pme_short_desc = "Completion stall due to a Branch Unit", -+ .pme_long_desc = "Completion stall due to a Branch Unit.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_BRU_CRU ] = { -+ .pme_name = "PM_CMPLU_STALL_BRU_CRU", -+ .pme_code = 0x2d018, -+ .pme_short_desc = "Completion stall due to IFU", -+ .pme_long_desc = "Completion stall due to IFU.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_COQ_FULL ] = { -+ .pme_name = "PM_CMPLU_STALL_COQ_FULL", -+ .pme_code = 0x30026, -+ .pme_short_desc = "Completion stall due to CO q full", -+ .pme_long_desc = "Completion stall due to CO q full.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_DCACHE_MISS ] = { -+ .pme_name = "PM_CMPLU_STALL_DCACHE_MISS", -+ .pme_code = 0x2c012, -+ .pme_short_desc = "Completion stall by Dcache miss", -+ .pme_long_desc = "Completion stall by Dcache miss.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_DMISS_L21_L31 ] = { -+ .pme_name = "PM_CMPLU_STALL_DMISS_L21_L31", -+ .pme_code = 0x2c018, -+ .pme_short_desc = "Completion stall by Dcache miss which resolved on chip ( excluding local L2/L3)", -+ .pme_long_desc = "Completion stall by Dcache miss which resolved on chip ( excluding local L2/L3).", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_DMISS_L2L3 ] = { -+ .pme_name = "PM_CMPLU_STALL_DMISS_L2L3", -+ .pme_code = 0x2c016, -+ .pme_short_desc = "Completion stall by Dcache miss which resolved in L2/L3", -+ .pme_long_desc = "Completion stall by Dcache miss which resolved in L2/L3.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_DMISS_L2L3_CONFLICT ] = { -+ .pme_name = "PM_CMPLU_STALL_DMISS_L2L3_CONFLICT", -+ .pme_code = 0x4c016, -+ .pme_short_desc = "Completion stall due to cache miss due to L2 l3 conflict", -+ .pme_long_desc = "Completion stall due to cache miss resolving in core's L2/L3 with a conflict.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_DMISS_L3MISS ] = { -+ .pme_name = "PM_CMPLU_STALL_DMISS_L3MISS", -+ .pme_code = 0x4c01a, -+ .pme_short_desc = "Completion stall due to cache miss resolving missed the L3", -+ .pme_long_desc = "Completion stall due to cache miss resolving missed the L3.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_DMISS_LMEM ] = { -+ .pme_name = "PM_CMPLU_STALL_DMISS_LMEM", -+ .pme_code = 0x4c018, -+ .pme_short_desc = "GCT empty by branch mispredict + IC miss", -+ .pme_long_desc = "Completion stall due to cache miss resolving in core's Local Memory.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_DMISS_REMOTE ] = { -+ .pme_name = "PM_CMPLU_STALL_DMISS_REMOTE", -+ .pme_code = 0x2c01c, -+ .pme_short_desc = "Completion stall by Dcache miss which resolved from remote chip (cache or memory)", -+ .pme_long_desc = "Completion stall by Dcache miss which resolved on chip ( excluding local L2/L3).", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_ERAT_MISS ] = { -+ .pme_name = "PM_CMPLU_STALL_ERAT_MISS", -+ .pme_code = 0x4c012, -+ .pme_short_desc = "Completion stall due to LSU reject ERAT miss", -+ .pme_long_desc = "Completion stall due to LSU reject ERAT miss.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_FLUSH ] = { -+ .pme_name = "PM_CMPLU_STALL_FLUSH", -+ .pme_code = 0x30038, -+ .pme_short_desc = "completion stall due to flush by own thread", -+ .pme_long_desc = "completion stall due to flush by own thread.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_FXLONG ] = { -+ .pme_name = "PM_CMPLU_STALL_FXLONG", -+ .pme_code = 0x4d016, -+ .pme_short_desc = "Completion stall due to a long latency fixed point instruction", -+ .pme_long_desc = "Completion stall due to a long latency fixed point instruction.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_FXU ] = { -+ .pme_name = "PM_CMPLU_STALL_FXU", -+ .pme_code = 0x2d016, -+ .pme_short_desc = "Completion stall due to FXU", -+ .pme_long_desc = "Completion stall due to FXU.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_HWSYNC ] = { -+ .pme_name = "PM_CMPLU_STALL_HWSYNC", -+ .pme_code = 0x30036, -+ .pme_short_desc = "completion stall due to hwsync", -+ .pme_long_desc = "completion stall due to hwsync.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_LOAD_FINISH ] = { -+ .pme_name = "PM_CMPLU_STALL_LOAD_FINISH", -+ .pme_code = 0x4d014, -+ .pme_short_desc = "Completion stall due to a Load finish", -+ .pme_long_desc = "Completion stall due to a Load finish.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_LSU ] = { -+ .pme_name = "PM_CMPLU_STALL_LSU", -+ .pme_code = 0x2c010, -+ .pme_short_desc = "Completion stall by LSU instruction", -+ .pme_long_desc = "Completion stall by LSU instruction.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_LWSYNC ] = { -+ .pme_name = "PM_CMPLU_STALL_LWSYNC", -+ .pme_code = 0x10036, -+ .pme_short_desc = "completion stall due to isync/lwsync", -+ .pme_long_desc = "completion stall due to isync/lwsync.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_MEM_ECC_DELAY ] = { -+ .pme_name = "PM_CMPLU_STALL_MEM_ECC_DELAY", -+ .pme_code = 0x30028, -+ .pme_short_desc = "Completion stall due to mem ECC delay", -+ .pme_long_desc = "Completion stall due to mem ECC delay.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_NTCG_FLUSH ] = { -+ .pme_name = "PM_CMPLU_STALL_NTCG_FLUSH", -+ .pme_code = 0x2e01e, -+ .pme_short_desc = "Completion stall due to ntcg flush", -+ .pme_long_desc = "Completion stall due to reject (load hit store).", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_OTHER_CMPL ] = { -+ .pme_name = "PM_CMPLU_STALL_OTHER_CMPL", -+ .pme_code = 0x30006, -+ .pme_short_desc = "Instructions core completed while this thread was stalled.", -+ .pme_long_desc = "Instructions core completed while this thread was stalled.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_REJECT ] = { -+ .pme_name = "PM_CMPLU_STALL_REJECT", -+ .pme_code = 0x4c010, -+ .pme_short_desc = "Completion stall due to LSU reject", -+ .pme_long_desc = "Completion stall due to LSU reject.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_REJECT_LHS ] = { -+ .pme_name = "PM_CMPLU_STALL_REJECT_LHS", -+ .pme_code = 0x2c01a, -+ .pme_short_desc = "Completion stall due to reject (load hit store)", -+ .pme_long_desc = "Completion stall due to reject (load hit store).", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_REJ_LMQ_FULL ] = { -+ .pme_name = "PM_CMPLU_STALL_REJ_LMQ_FULL", -+ .pme_code = 0x4c014, -+ .pme_short_desc = "Completion stall due to LSU reject LMQ full", -+ .pme_long_desc = "Completion stall due to LSU reject LMQ full.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_SCALAR ] = { -+ .pme_name = "PM_CMPLU_STALL_SCALAR", -+ .pme_code = 0x4d010, -+ .pme_short_desc = "Completion stall due to VSU scalar instruction", -+ .pme_long_desc = "Completion stall due to VSU scalar instruction.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_SCALAR_LONG ] = { -+ .pme_name = "PM_CMPLU_STALL_SCALAR_LONG", -+ .pme_code = 0x2d010, -+ .pme_short_desc = "Completion stall due to VSU scalar long latency instruction", -+ .pme_long_desc = "Completion stall due to VSU scalar long latency instruction.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_STORE ] = { -+ .pme_name = "PM_CMPLU_STALL_STORE", -+ .pme_code = 0x2c014, -+ .pme_short_desc = "Completion stall by stores this includes store agent finishes in pipe LS0/LS1 and store data finishes in LS2/LS3", -+ .pme_long_desc = "Completion stall by stores.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_ST_FWD ] = { -+ .pme_name = "PM_CMPLU_STALL_ST_FWD", -+ .pme_code = 0x4c01c, -+ .pme_short_desc = "Completion stall due to store forward", -+ .pme_long_desc = "Completion stall due to store forward.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_THRD ] = { -+ .pme_name = "PM_CMPLU_STALL_THRD", -+ .pme_code = 0x1001c, -+ .pme_short_desc = "Completion Stalled due to thread conflict. Group ready to complete but it was another thread's turn", -+ .pme_long_desc = "Completion stall due to thread conflict.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_VECTOR ] = { -+ .pme_name = "PM_CMPLU_STALL_VECTOR", -+ .pme_code = 0x2d014, -+ .pme_short_desc = "Completion stall due to VSU vector instruction", -+ .pme_long_desc = "Completion stall due to VSU vector instruction.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_VECTOR_LONG ] = { -+ .pme_name = "PM_CMPLU_STALL_VECTOR_LONG", -+ .pme_code = 0x4d012, -+ .pme_short_desc = "Completion stall due to VSU vector long instruction", -+ .pme_long_desc = "Completion stall due to VSU vector long instruction.", -+}, -+[ POWER8_PME_PM_CMPLU_STALL_VSU ] = { -+ .pme_name = "PM_CMPLU_STALL_VSU", -+ .pme_code = 0x2d012, -+ .pme_short_desc = "Completion stall due to VSU instruction", -+ .pme_long_desc = "Completion stall due to VSU instruction.", -+}, -+[ POWER8_PME_PM_DATA_FROM_L2 ] = { -+ .pme_name = "PM_DATA_FROM_L2", -+ .pme_code = 0x1c042, -+ .pme_short_desc = "The processor's data cache was reloaded from local core's L2 due to a demand load or demand load plus prefetch controlled by MMCR1[16]", -+ .pme_long_desc = "The processor's data cache was reloaded from local core's L2 due to a demand load or demand load plus prefetch controlled by MMCR1[20].", -+}, -+[ POWER8_PME_PM_DATA_FROM_L2_NO_CONFLICT ] = { -+ .pme_name = "PM_DATA_FROM_L2_NO_CONFLICT", -+ .pme_code = 0x1c040, -+ .pme_short_desc = "The processor's data cache was reloaded from local core's L2 without conflict due to a demand load or demand load plus prefetch controlled by MMCR1[16]", -+ .pme_long_desc = "The processor's data cache was reloaded from local core's L2 without conflict due to a demand load or demand load plus prefetch controlled by MMCR1[20] .", -+}, -+[ POWER8_PME_PM_DATA_FROM_L3 ] = { -+ .pme_name = "PM_DATA_FROM_L3", -+ .pme_code = 0x4c042, -+ .pme_short_desc = "The processor's data cache was reloaded from local core's L3 due to a demand load", -+ .pme_long_desc = "The processor's data cache was reloaded from local core's L3 due to a demand load.", -+}, -+[ POWER8_PME_PM_DATA_FROM_L3MISS_MOD ] = { -+ .pme_name = "PM_DATA_FROM_L3MISS_MOD", -+ .pme_code = 0x4c04e, -+ .pme_short_desc = "The processor's data cache was reloaded from a location other than the local core's L3 due to a demand load", -+ .pme_long_desc = "The processor's data cache was reloaded from a location other than the local core's L3 due to a demand load.", -+}, -+[ POWER8_PME_PM_DATA_FROM_L3_NO_CONFLICT ] = { -+ .pme_name = "PM_DATA_FROM_L3_NO_CONFLICT", -+ .pme_code = 0x1c044, -+ .pme_short_desc = "The processor's data cache was reloaded from local core's L3 without conflict due to a demand load or demand load plus prefetch controlled by MMCR1[16]", -+ .pme_long_desc = "The processor's data cache was reloaded from local core's L3 without conflict due to a demand load or demand load plus prefetch controlled by MMCR1[20].", -+}, -+[ POWER8_PME_PM_DATA_FROM_LMEM ] = { -+ .pme_name = "PM_DATA_FROM_LMEM", -+ .pme_code = 0x2c048, -+ .pme_short_desc = "The processor's data cache was reloaded from the local chip's Memory due to a demand load", -+ .pme_long_desc = "The processor's data cache was reloaded from the local chip's Memory due to a demand load.", -+}, -+[ POWER8_PME_PM_DATA_FROM_MEMORY ] = { -+ .pme_name = "PM_DATA_FROM_MEMORY", -+ .pme_code = 0x2c04c, -+ .pme_short_desc = "The processor's data cache was reloaded from a memory location including L4 from local remote or distant due to a demand load", -+ .pme_long_desc = "The processor's data cache was reloaded from a memory location including L4 from local remote or distant due to a demand load.", -+}, -+[ POWER8_PME_PM_DC_PREF_STREAM_STRIDED_CONF ] = { -+ .pme_name = "PM_DC_PREF_STREAM_STRIDED_CONF", -+ .pme_code = 0x3e050, -+ .pme_short_desc = "A demand load referenced a line in an active strided prefetch stream. The stream could have been allocated through the hardware prefetch mechanism or through software.", -+ .pme_long_desc = "A demand load referenced a line in an active strided prefetch stream. The stream could have been allocated through the hardware prefetch mechanism or through software..", -+}, -+[ POWER8_PME_PM_GCT_NOSLOT_BR_MPRED ] = { -+ .pme_name = "PM_GCT_NOSLOT_BR_MPRED", -+ .pme_code = 0x4d01e, -+ .pme_short_desc = "Gct empty fo this thread due to branch misprediction", -+ .pme_long_desc = "Gct empty for this thread due to branch misprediction.", -+}, -+[ POWER8_PME_PM_GCT_NOSLOT_BR_MPRED_ICMISS ] = { -+ .pme_name = "PM_GCT_NOSLOT_BR_MPRED_ICMISS", -+ .pme_code = 0x4d01a, -+ .pme_short_desc = "Gct empty for this thread due to Icache Miss and branch mispred", -+ .pme_long_desc = "Gct empty for this thread due to Icache Miss and branch mispred.", -+}, -+[ POWER8_PME_PM_GCT_NOSLOT_DISP_HELD_ISSQ ] = { -+ .pme_name = "PM_GCT_NOSLOT_DISP_HELD_ISSQ", -+ .pme_code = 0x2d01e, -+ .pme_short_desc = "Gct empty for this thread due to dispatch hold on this thread due to Issue q full", -+ .pme_long_desc = "Gct empty for this thread due to dispatch hold on this thread due to Issue q full.", -+}, -+[ POWER8_PME_PM_GCT_NOSLOT_DISP_HELD_OTHER ] = { -+ .pme_name = "PM_GCT_NOSLOT_DISP_HELD_OTHER", -+ .pme_code = 0x2e010, -+ .pme_short_desc = "Gct empty for this thread due to dispatch hold on this thread due to sync", -+ .pme_long_desc = "Gct empty for this thread due to dispatch hold on this thread due to sync.", -+}, -+[ POWER8_PME_PM_GCT_NOSLOT_DISP_HELD_SRQ ] = { -+ .pme_name = "PM_GCT_NOSLOT_DISP_HELD_SRQ", -+ .pme_code = 0x2d01c, -+ .pme_short_desc = "Gct empty for this thread due to dispatch hold on this thread due to SRQ full", -+ .pme_long_desc = "Gct empty for this thread due to dispatch hold on this thread due to SRQ full.", -+}, -+[ POWER8_PME_PM_GCT_NOSLOT_IC_L3MISS ] = { -+ .pme_name = "PM_GCT_NOSLOT_IC_L3MISS", -+ .pme_code = 0x4e010, -+ .pme_short_desc = "Gct empty for this thread due to icach l3 miss", -+ .pme_long_desc = "Gct empty for this thread due to icach l3 miss.", -+}, -+[ POWER8_PME_PM_GCT_NOSLOT_IC_MISS ] = { -+ .pme_name = "PM_GCT_NOSLOT_IC_MISS", -+ .pme_code = 0x2d01a, -+ .pme_short_desc = "Gct empty for this thread due to Icache Miss", -+ .pme_long_desc = "Gct empty for this thread due to Icache Miss.", -+}, -+[ POWER8_PME_PM_GRP_DISP ] = { -+ .pme_name = "PM_GRP_DISP", -+ .pme_code = 0x3000a, -+ .pme_short_desc = "group dispatch", -+ .pme_long_desc = "dispatch_success (Group Dispatched).", -+}, -+[ POWER8_PME_PM_GRP_MRK ] = { -+ .pme_name = "PM_GRP_MRK", -+ .pme_code = 0x10130, -+ .pme_short_desc = "Instruction Marked", -+ .pme_long_desc = "Instruction marked in idu.", -+}, -+[ POWER8_PME_PM_HV_CYC ] = { -+ .pme_name = "PM_HV_CYC", -+ .pme_code = 0x2000a, -+ .pme_short_desc = "cycles in hypervisor mode", -+ .pme_long_desc = "cycles in hypervisor mode .", -+}, -+[ POWER8_PME_PM_INST_CMPL ] = { -+ .pme_name = "PM_INST_CMPL", -+ .pme_code = 0x10002, -+ .pme_short_desc = "Number of PowerPC Instructions that completed.", -+ .pme_long_desc = "PPC Instructions Finished (completed).", -+}, -+[ POWER8_PME_PM_IOPS_CMPL ] = { -+ .pme_name = "PM_IOPS_CMPL", -+ .pme_code = 0x10014, -+ .pme_short_desc = "Internal Operations completed", -+ .pme_long_desc = "IOPS Completed.", -+}, -+[ POWER8_PME_PM_LD_CMPL ] = { -+ .pme_name = "PM_LD_CMPL", -+ .pme_code = 0x1002e, -+ .pme_short_desc = "count of Loads completed", -+ .pme_long_desc = "count of Loads completed.", -+}, -+[ POWER8_PME_PM_LD_L3MISS_PEND_CYC ] = { -+ .pme_name = "PM_LD_L3MISS_PEND_CYC", -+ .pme_code = 0x10062, -+ .pme_short_desc = "Cycles L3 miss was pending for this thread", -+ .pme_long_desc = "Cycles L3 miss was pending for this thread.", -+}, -+[ POWER8_PME_PM_MRK_DATA_FROM_L2 ] = { -+ .pme_name = "PM_MRK_DATA_FROM_L2", -+ .pme_code = 0x1d142, -+ .pme_short_desc = "The processor's data cache was reloaded from local core's L2 due to a marked load", -+ .pme_long_desc = "The processor's data cache was reloaded from local core's L2 due to a marked load.", -+}, -+[ POWER8_PME_PM_MRK_DATA_FROM_L2MISS_CYC ] = { -+ .pme_name = "PM_MRK_DATA_FROM_L2MISS_CYC", -+ .pme_code = 0x4c12e, -+ .pme_short_desc = "Duration in cycles to reload from a location other than the local core's L2 due to a marked load", -+ .pme_long_desc = "Duration in cycles to reload from a location other than the local core's L2 due to a marked load.", -+}, -+[ POWER8_PME_PM_MRK_DATA_FROM_L2_CYC ] = { -+ .pme_name = "PM_MRK_DATA_FROM_L2_CYC", -+ .pme_code = 0x4c122, -+ .pme_short_desc = "Duration in cycles to reload from local core's L2 due to a marked load", -+ .pme_long_desc = "Duration in cycles to reload from local core's L2 due to a marked load.", -+}, -+[ POWER8_PME_PM_MRK_DATA_FROM_L2_NO_CONFLICT ] = { -+ .pme_name = "PM_MRK_DATA_FROM_L2_NO_CONFLICT", -+ .pme_code = 0x1d140, -+ .pme_short_desc = "The processor's data cache was reloaded from local core's L2 without conflict due to a marked load", -+ .pme_long_desc = "The processor's data cache was reloaded from local core's L2 without conflict due to a marked load.", -+}, -+[ POWER8_PME_PM_MRK_DATA_FROM_L2_NO_CONFLICT_CYC ] = { -+ .pme_name = "PM_MRK_DATA_FROM_L2_NO_CONFLICT_CYC", -+ .pme_code = 0x4c120, -+ .pme_short_desc = "Duration in cycles to reload from local core's L2 without conflict due to a marked load", -+ .pme_long_desc = "Duration in cycles to reload from local core's L2 without conflict due to a marked load.", -+}, -+[ POWER8_PME_PM_MRK_DATA_FROM_L3 ] = { -+ .pme_name = "PM_MRK_DATA_FROM_L3", -+ .pme_code = 0x4d142, -+ .pme_short_desc = "The processor's data cache was reloaded from local core's L3 due to a marked load", -+ .pme_long_desc = "The processor's data cache was reloaded from local core's L3 due to a marked load.", -+}, -+[ POWER8_PME_PM_MRK_DATA_FROM_L3MISS_CYC ] = { -+ .pme_name = "PM_MRK_DATA_FROM_L3MISS_CYC", -+ .pme_code = 0x2d12e, -+ .pme_short_desc = "Duration in cycles to reload from a location other than the local core's L3 due to a marked load", -+ .pme_long_desc = "Duration in cycles to reload from a location other than the local core's L3 due to a marked load.", -+}, -+[ POWER8_PME_PM_MRK_DATA_FROM_L3_CYC ] = { -+ .pme_name = "PM_MRK_DATA_FROM_L3_CYC", -+ .pme_code = 0x2d122, -+ .pme_short_desc = "Duration in cycles to reload from local core's L3 due to a marked load", -+ .pme_long_desc = "Duration in cycles to reload from local core's L3 due to a marked load.", -+}, -+[ POWER8_PME_PM_MRK_DATA_FROM_L3_NO_CONFLICT ] = { -+ .pme_name = "PM_MRK_DATA_FROM_L3_NO_CONFLICT", -+ .pme_code = 0x1d144, -+ .pme_short_desc = "The processor's data cache was reloaded from local core's L3 without conflict due to a marked load", -+ .pme_long_desc = "The processor's data cache was reloaded from local core's L3 without conflict due to a marked load.", -+}, -+[ POWER8_PME_PM_MRK_DATA_FROM_L3_NO_CONFLICT_CYC ] = { -+ .pme_name = "PM_MRK_DATA_FROM_L3_NO_CONFLICT_CYC", -+ .pme_code = 0x4c124, -+ .pme_short_desc = "Duration in cycles to reload from local core's L3 without conflict due to a marked load", -+ .pme_long_desc = "Duration in cycles to reload from local core's L3 without conflict due to a marked load.", -+}, -+[ POWER8_PME_PM_MRK_DATA_FROM_LL4 ] = { -+ .pme_name = "PM_MRK_DATA_FROM_LL4", -+ .pme_code = 0x1d14c, -+ .pme_short_desc = "The processor's data cache was reloaded from the local chip's L4 cache due to a marked load", -+ .pme_long_desc = "The processor's data cache was reloaded from the local chip's L4 cache due to a marked load.", -+}, -+[ POWER8_PME_PM_MRK_DATA_FROM_LL4_CYC ] = { -+ .pme_name = "PM_MRK_DATA_FROM_LL4_CYC", -+ .pme_code = 0x4c12c, -+ .pme_short_desc = "Duration in cycles to reload from the local chip's L4 cache due to a marked load", -+ .pme_long_desc = "Duration in cycles to reload from the local chip's L4 cache due to a marked load.", -+}, -+[ POWER8_PME_PM_MRK_DATA_FROM_LMEM ] = { -+ .pme_name = "PM_MRK_DATA_FROM_LMEM", -+ .pme_code = 0x2d148, -+ .pme_short_desc = "The processor's data cache was reloaded from the local chip's Memory due to a marked load", -+ .pme_long_desc = "The processor's data cache was reloaded from the local chip's Memory due to a marked load.", -+}, -+[ POWER8_PME_PM_MRK_DATA_FROM_LMEM_CYC ] = { -+ .pme_name = "PM_MRK_DATA_FROM_LMEM_CYC", -+ .pme_code = 0x4d128, -+ .pme_short_desc = "Duration in cycles to reload from the local chip's Memory due to a marked load", -+ .pme_long_desc = "Duration in cycles to reload from the local chip's Memory due to a marked load.", -+}, -+[ POWER8_PME_PM_MRK_DATA_FROM_MEMORY ] = { -+ .pme_name = "PM_MRK_DATA_FROM_MEMORY", -+ .pme_code = 0x2d14c, -+ .pme_short_desc = "The processor's data cache was reloaded from a memory location including L4 from local remote or distant due to a marked load", -+ .pme_long_desc = "The processor's data cache was reloaded from a memory location including L4 from local remote or distant due to a marked load.", -+}, -+[ POWER8_PME_PM_MRK_DATA_FROM_MEMORY_CYC ] = { -+ .pme_name = "PM_MRK_DATA_FROM_MEMORY_CYC", -+ .pme_code = 0x4d12c, -+ .pme_short_desc = "Duration in cycles to reload from a memory location including L4 from local remote or distant due to a marked load", -+ .pme_long_desc = "Duration in cycles to reload from a memory location including L4 from local remote or distant due to a marked load.", -+}, -+[ POWER8_PME_PM_MRK_GRP_CMPL ] = { -+ .pme_name = "PM_MRK_GRP_CMPL", -+ .pme_code = 0x40130, -+ .pme_short_desc = "marked instruction finished (completed)", -+ .pme_long_desc = "marked instruction finished (completed).", -+}, -+[ POWER8_PME_PM_MRK_INST_DECODED ] = { -+ .pme_name = "PM_MRK_INST_DECODED", -+ .pme_code = 0x20130, -+ .pme_short_desc = "marked instruction decoded", -+ .pme_long_desc = "marked instruction decoded. Name from ISU?", -+}, -+[ POWER8_PME_PM_MRK_L2_RC_DISP ] = { -+ .pme_name = "PM_MRK_L2_RC_DISP", -+ .pme_code = 0x20114, -+ .pme_short_desc = "Marked Instruction RC dispatched in L2", -+ .pme_long_desc = "Marked Instruction RC dispatched in L2.", -+}, -+[ POWER8_PME_PM_MRK_LD_MISS_L1_CYC ] = { -+ .pme_name = "PM_MRK_LD_MISS_L1_CYC", -+ .pme_code = 0x4013e, -+ .pme_short_desc = "Marked ld latency", -+ .pme_long_desc = "Marked ld latency.", -+}, -+[ POWER8_PME_PM_MRK_STALL_CMPLU_CYC ] = { -+ .pme_name = "PM_MRK_STALL_CMPLU_CYC", -+ .pme_code = 0x3013e, -+ .pme_short_desc = "Marked Group completion Stall", -+ .pme_long_desc = "Marked Group Completion Stall cycles (use edge detect to count).", -+}, -+[ POWER8_PME_PM_NEST_REF_CLK ] = { -+ .pme_name = "PM_NEST_REF_CLK", -+ .pme_code = 0x3006e, -+ .pme_short_desc = "Nest reference clocks", -+ .pme_long_desc = "Nest reference clocks.", -+}, -+[ POWER8_PME_PM_PMC1_OVERFLOW ] = { -+ .pme_name = "PM_PMC1_OVERFLOW", -+ .pme_code = 0x20010, -+ .pme_short_desc = "Overflow from counter 1", -+ .pme_long_desc = "Overflow from counter 1.", -+}, -+[ POWER8_PME_PM_PMC2_OVERFLOW ] = { -+ .pme_name = "PM_PMC2_OVERFLOW", -+ .pme_code = 0x30010, -+ .pme_short_desc = "Overflow from counter 2", -+ .pme_long_desc = "Overflow from counter 2.", -+}, -+[ POWER8_PME_PM_PMC3_OVERFLOW ] = { -+ .pme_name = "PM_PMC3_OVERFLOW", -+ .pme_code = 0x40010, -+ .pme_short_desc = "Overflow from counter 3", -+ .pme_long_desc = "Overflow from counter 3.", -+}, -+[ POWER8_PME_PM_PMC4_OVERFLOW ] = { -+ .pme_name = "PM_PMC4_OVERFLOW", -+ .pme_code = 0x10010, -+ .pme_short_desc = "Overflow from counter 4", -+ .pme_long_desc = "Overflow from counter 4.", -+}, -+[ POWER8_PME_PM_PMC6_OVERFLOW ] = { -+ .pme_name = "PM_PMC6_OVERFLOW", -+ .pme_code = 0x30024, -+ .pme_short_desc = "Overflow from counter 6", -+ .pme_long_desc = "Overflow from counter 6.", -+}, -+[ POWER8_PME_PM_PPC_CMPL ] = { -+ .pme_name = "PM_PPC_CMPL", -+ .pme_code = 0x40002, -+ .pme_short_desc = "PPC Instructions Finished (completed)", -+ .pme_long_desc = "PPC Instructions Finished (completed).", -+}, -+[ POWER8_PME_PM_THRD_ALL_RUN_CYC ] = { -+ .pme_name = "PM_THRD_ALL_RUN_CYC", -+ .pme_code = 0x2000c, -+ .pme_short_desc = "All Threads in Run_cycles (was both threads in run_cycles)", -+ .pme_long_desc = "All Threads in Run_cycles (was both threads in run_cycles).", -+}, -+[ POWER8_PME_PM_THRESH_NOT_MET ] = { -+ .pme_name = "PM_THRESH_NOT_MET", -+ .pme_code = 0x4016e, -+ .pme_short_desc = "Threshold counter did not meet threshold", -+ .pme_long_desc = "Threshold counter did not meet threshold.", -+}, -+}; -+#endif -diff --git a/lib/pfmlib_common.c b/lib/pfmlib_common.c -index 7b11b46..71bddd9 100644 ---- a/lib/pfmlib_common.c -+++ b/lib/pfmlib_common.c -@@ -137,6 +137,7 @@ static pfmlib_pmu_t *pfmlib_pmus[]= - &power5p_support, - &power6_support, - &power7_support, -+ &power8_support, - &torrent_support, - #endif - -diff --git a/lib/pfmlib_power8.c b/lib/pfmlib_power8.c -new file mode 100644 -index 0000000..d274b59 ---- /dev/null -+++ b/lib/pfmlib_power8.c -@@ -0,0 +1,57 @@ -+/* -+ * pfmlib_power8.c : IBM Power8 support -+ * -+ * Copyright (C) IBM Corporation, 2013. All rights reserved. -+ * Contributed by Carl Love (carll@us.ibm.com) -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a copy -+ * of this software and associated documentation files (the "Software"), to deal -+ * in the Software without restriction, including without limitation the rights -+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -+ * of the Software, and to permit persons to whom the Software is furnished to do so, -+ * subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in all -+ * copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -+ * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE -+ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -+ */ -+/* private headers */ -+#include "pfmlib_priv.h" -+#include "pfmlib_power_priv.h" -+#include "events/power8_events.h" -+ -+static int -+pfm_power8_detect(void* this) -+{ -+ if (__is_processor(PV_POWER8)) -+ return PFM_SUCCESS; -+ return PFM_ERR_NOTSUPP; -+} -+ -+pfmlib_pmu_t power8_support={ -+ .desc = "POWER8", -+ .name = "power8", -+ .pmu = PFM_PMU_POWER8, -+ .pme_count = LIBPFM_ARRAY_SIZE(power8_pe), -+ .type = PFM_PMU_TYPE_CORE, -+ .num_cntrs = 4, -+ .num_fixed_cntrs = 2, -+ .max_encoding = 1, -+ .pe = power8_pe, -+ .pmu_detect = pfm_power8_detect, -+ .get_event_encoding[PFM_OS_NONE] = pfm_gen_powerpc_get_encoding, -+ PFMLIB_ENCODE_PERF(pfm_gen_powerpc_get_perf_encoding), -+ PFMLIB_VALID_PERF_PATTRS(pfm_gen_powerpc_perf_validate_pattrs), -+ .get_event_first = pfm_gen_powerpc_get_event_first, -+ .get_event_next = pfm_gen_powerpc_get_event_next, -+ .event_is_valid = pfm_gen_powerpc_event_is_valid, -+ .validate_table = pfm_gen_powerpc_validate_table, -+ .get_event_info = pfm_gen_powerpc_get_event_info, -+ .get_event_attr_info = pfm_gen_powerpc_get_event_attr_info, -+}; -diff --git a/lib/pfmlib_power_priv.h b/lib/pfmlib_power_priv.h -index 2f66c22..2721771 100644 ---- a/lib/pfmlib_power_priv.h -+++ b/lib/pfmlib_power_priv.h -@@ -93,6 +93,7 @@ typedef struct { - #define PV_POWER7p 0x004a - #define PV_970MP 0x0044 - #define PV_970GX 0x0045 -+#define PV_POWER8 0x004b - - extern int pfm_gen_powerpc_get_event_info(void *this, int pidx, pfm_event_info_t *info); - extern int pfm_gen_powerpc_get_event_attr_info(void *this, int pidx, int umask_idx, pfm_event_attr_info_t *info); -diff --git a/lib/pfmlib_priv.h b/lib/pfmlib_priv.h -index d90f015..8e203d4 100644 ---- a/lib/pfmlib_priv.h -+++ b/lib/pfmlib_priv.h -@@ -264,6 +264,7 @@ extern pfmlib_pmu_t power5_support; - extern pfmlib_pmu_t power5p_support; - extern pfmlib_pmu_t power6_support; - extern pfmlib_pmu_t power7_support; -+extern pfmlib_pmu_t power8_support; - extern pfmlib_pmu_t torrent_support; - extern pfmlib_pmu_t sparc_support; - extern pfmlib_pmu_t sparc_ultra12_support; diff --git a/libpfm.spec b/libpfm.spec index 2261c97..3f6ce24 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,15 +9,16 @@ %endif Name: libpfm -Version: 4.4.0 -Release: 5.217.gbca43a5%{?dist} +Version: 4.5.0 +Release: 1%{?dist} Summary: Library to encode performance events for use by perf tool Group: System Environment/Libraries License: MIT URL: http://perfmon2.sourceforge.net/ -Source0: %{name}-%{version}-5.217.gbca43a5.tar.gz +Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz +Patch12: libpfm-ac57.patch %if %{with python} BuildRequires: python-devel @@ -62,6 +63,8 @@ Python bindings for libpfm4 and perf_event_open system call. %prep %setup -q +%patch12 -p1 + %build %if %{with python} %global python_config CONFIG_PFMLIB_NOPYTHON=n @@ -108,16 +111,8 @@ make \ %endif %changelog -* Wed Jan 15 2014 Lukas Berk - 4.4.0-5.217.gbca43a5 -- Automated weekly rawhide release - -* Mon Nov 25 2013 Lukas Berk - 4.4.0-3.200.g9df2031 -- Automated weekly rawhide release -- Removed patch1 set - -* Tue Nov 19 2013 Lukas Berk - 4.4.0-3.199.g0b87987 -- Automated weekly rawhide Release -- Comment out Patch1 as applied upstream +* Fri May 23 2014 William Cohen 4.5.0-1 +- Rebase on libpfm-4.5.0. * Sat Aug 03 2013 Fedora Release Engineering - 4.4.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild diff --git a/sources b/sources index a5c41db..38403e0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -2b01e4f1bdec4d0b0283f0b98c942a40 libpfm-4.4.0-5.217.gbca43a5.tar.gz +8eda1e3741c8f3359a33ebd553243333 libpfm-4.5.0.tar.gz From 14b554c6b8acc8eba360a158f1403edf2cd67a7d Mon Sep 17 00:00:00 2001 From: William Cohen Date: Fri, 23 May 2014 14:35:43 -0400 Subject: [PATCH 19/94] Add Arm Cortex a53 support. --- libpfm-ac53.patch | 544 ++++++++++++++++++++++++++++++++++++++++++++++ libpfm.spec | 7 +- 2 files changed, 550 insertions(+), 1 deletion(-) create mode 100644 libpfm-ac53.patch diff --git a/libpfm-ac53.patch b/libpfm-ac53.patch new file mode 100644 index 0000000..c76251a --- /dev/null +++ b/libpfm-ac53.patch @@ -0,0 +1,544 @@ +commit 6d1faa5bd1c0564b24cf030f118cd9782e1b4e0c +Author: Stephane Eranian +Date: Thu May 22 18:44:47 2014 +0200 + + Add missing arm_cortex_a57.h header dependency + + Was missing. We compile A57 for 32-bit arm as well. + + Signed-off-by: Stephane Eranian + +diff --git a/lib/Makefile b/lib/Makefile +index 6ca3287..585cc3e 100644 +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -281,7 +281,8 @@ INC_ARM=events/arm_cortex_a8_events.h \ + INC_ARM=pfmlib_arm_priv.h \ + events/arm_cortex_a8_events.h \ + events/arm_cortex_a9_events.h \ +- events/arm_cortex_a15_events.h ++ events/arm_cortex_a15_events.h \ ++ events/arm_cortex_a57_events.h + + INC_ARM64=events/arm_cortex_a57_events.h + +commit 6af79d5186b7593c4f7e41024b78453debceb45f +Author: Stephane Eranian +Date: Thu May 22 19:14:52 2014 +0200 + + Add ARM Cortex A53 support + + This patch adds support for the ARM Cortex A53 core PMU as + documented in r0p2 version f the Cortex-A53 MPCore processor + technical reference manual Table 12.28. + + Support is provided for both 32 and 64-bit modes. + + Includes man page, and validation tests. + + Signed-off-by: Stephane Eranian + +diff --git a/README b/README +index 334c78a..e74238f 100644 +--- a/README ++++ b/README +@@ -57,6 +57,7 @@ The library supports many PMUs. The current version can handle: + ARMV7 Cortex A8 + ARMV7 Cortex A9 + ARMV7 Cortex A15 ++ ARMV8 Cortex A57, A53 + Qualcomm Krait + + - For SPARC +diff --git a/docs/Makefile b/docs/Makefile +index 9b79ec7..c7d797e 100644 +--- a/docs/Makefile ++++ b/docs/Makefile +@@ -76,11 +76,17 @@ endif + endif + + ifeq ($(CONFIG_PFMLIB_ARCH_ARM),y) +-ARCH_MAN += libpfm_arm_ac57.3 libpfm_arm_ac15.3 libpfm_arm_ac8.3 libpfm_arm_ac9.3 libpfm_arm_qcom_krait.3 ++ARCH_MAN += libpfm_arm_ac57.3 \ ++ libpfm_arm_ac53.3 \ ++ libpfm_arm_ac15.3 \ ++ libpfm_arm_ac8.3 \ ++ libpfm_arm_ac9.3 \ ++ libpfm_arm_qcom_krait.3 + endif + + ifeq ($(CONFIG_PFMLIB_ARCH_ARM64),y) +-ARCH_MAN += libpfm_arm_ac57.3 ++ARCH_MAN += libpfm_arm_ac57.3 \ ++ libpfm_arm_ac53.3 + endif + + ifeq ($(CONFIG_PFMLIB_ARCH_MIPS),y) +diff --git a/docs/man3/libpfm_arm_ac53.3 b/docs/man3/libpfm_arm_ac53.3 +new file mode 100644 +index 0000000..319accc +--- /dev/null ++++ b/docs/man3/libpfm_arm_ac53.3 +@@ -0,0 +1,36 @@ ++.TH LIBPFM 4 "May, 2014" "" "Linux Programmer's Manual" ++.SH NAME ++libpfm_arm_ac53 - support for ARM Cortex A53 PMU ++.SH SYNOPSIS ++.nf ++.B #include ++.sp ++.B PMU name: arm_ac53 ++.B PMU desc: ARM Cortex A53 ++.sp ++.SH DESCRIPTION ++The library supports the ARM Cortex A53 core PMU. ++ ++This PMU supports 6 counters and privilege levels filtering. ++It can operate in both 32 and 64 bit modes. ++ ++.SH MODIFIERS ++The following modifiers are supported on ARM Cortex A53: ++.TP ++.B u ++Measure at the user level. This corresponds to \fBPFM_PLM3\fR. ++This is a boolean modifier. ++.TP ++.B k ++Measure at the kernel level. This corresponds to \fBPFM_PLM0\fR. ++This is a boolean modifier. ++.TP ++.B hv ++Measure at the hypervisor level. This corresponds to \fBPFM_PLMH\fR. ++This is a boolean modifier. ++ ++.SH AUTHORS ++.nf ++Stephane Eranian ++.if ++.PP +diff --git a/include/perfmon/pfmlib.h b/include/perfmon/pfmlib.h +index b08df66..a7ec026 100644 +--- a/include/perfmon/pfmlib.h ++++ b/include/perfmon/pfmlib.h +@@ -238,6 +238,7 @@ typedef enum { + PFM_PMU_S390X_CPUM_SF, /* s390x: CPU-M sampling facility */ + + PFM_PMU_ARM_CORTEX_A57, /* ARM Cortex A57 (ARMv8) */ ++ PFM_PMU_ARM_CORTEX_A53, /* ARM Cortex A53 (ARMv8) */ + + /* MUST ADD NEW PMU MODELS HERE */ + +diff --git a/lib/Makefile b/lib/Makefile +index 585cc3e..5aaf4b3 100644 +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -282,9 +282,11 @@ INC_ARM=pfmlib_arm_priv.h \ + events/arm_cortex_a8_events.h \ + events/arm_cortex_a9_events.h \ + events/arm_cortex_a15_events.h \ +- events/arm_cortex_a57_events.h ++ events/arm_cortex_a57_events.h \ ++ events/arm_cortex_a53_events.h + +-INC_ARM64=events/arm_cortex_a57_events.h ++INC_ARM64=events/arm_cortex_a57_events.h \ ++ events/arm_cortex_a53_events.h + + INCDEP=$(INC_COMMON) $(INCARCH) + +diff --git a/lib/events/arm_cortex_a53_events.h b/lib/events/arm_cortex_a53_events.h +new file mode 100644 +index 0000000..c0d2bb6 +--- /dev/null ++++ b/lib/events/arm_cortex_a53_events.h +@@ -0,0 +1,190 @@ ++/* ++ * Copyright (c) 2014 Google Inc. All rights reserved ++ * Contributed by Stephane Eranian ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a copy ++ * of this software and associated documentation files (the "Software"), to deal ++ * in the Software without restriction, including without limitation the rights ++ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies ++ * of the Software, and to permit persons to whom the Software is furnished to do so, ++ * subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included in all ++ * copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, ++ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A ++ * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF ++ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE ++ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++ * ++ * Cortex A53 r0p2 ++ * based on Table 12.9 from the "Cortex A53 Technical Reference Manual" ++ */ ++ ++static const arm_entry_t arm_cortex_a53_pe[]={ ++ {.name = "SW_INCR", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x00, ++ .desc = "Instruction architecturally executed (condition check pass) Software increment" ++ }, ++ {.name = "L1I_CACHE_REFILL", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x01, ++ .desc = "Level 1 instruction cache refill" ++ }, ++ {.name = "L1I_TLB_REFILL", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x02, ++ .desc = "Level 1 instruction TLB refill" ++ }, ++ {.name = "L1D_CACHE_REFILL", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x03, ++ .desc = "Level 1 data cache refill" ++ }, ++ {.name = "L1D_CACHE_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x04, ++ .desc = "Level 1 data cache access" ++ }, ++ {.name = "L1D_TLB_REFILL", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x05, ++ .desc = "Level 1 data TLB refill" ++ }, ++ {.name = "LD_RETIRED", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x06, ++ .desc = "Load Instruction architecturally executed, condition check", ++ }, ++ {.name = "ST_RETIRED", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x07, ++ .desc = "Store Instruction architecturally executed, condition check", ++ }, ++ {.name = "INST_RETIRED", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x08, ++ .desc = "Instruction architecturally executed" ++ }, ++ {.name = "EXCEPTION_TAKEN", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x09, ++ .desc = "Exception taken" ++ }, ++ {.name = "EXCEPTION_RETURN", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x0a, ++ .desc = "Instruction architecturally executed (condition check pass) Exception return" ++ }, ++ {.name = "CID_WRITE_RETIRED", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x0b, ++ .desc = "Change to Context ID retired", ++ }, ++ {.name = "PC_WRITE_RETIRED", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x0c, ++ .desc = "Write to CONTEXTIDR, instruction architecturally executed, condition check pass" ++ }, ++ {.name = "BR_IMMED_RETIRED", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x0d, ++ .desc = "Software chnage of the PC, instruction architecturally executed, condition check pass" ++ }, ++ {.name = "UNALIGNED_LDST_RETIRED", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x0f, ++ .desc = "Procedure return, instruction architecturally executed, condition check pass" ++ }, ++ {.name = "BRANCH_MISPRED", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x10, ++ .desc = "Mispredicted or not predicted branch speculatively executed" ++ }, ++ {.name = "CPU_CYCLES", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x11, ++ .desc = "Cycles" ++ }, ++ {.name = "BRANCH_PRED", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x12, ++ .desc = "Predictable branch speculatively executed" ++ }, ++ {.name = "DATA_MEM_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x13, ++ .desc = "Data memory access" ++ }, ++ {.name = "L1I_CACHE_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x14, ++ .desc = "Level 1 instruction cache access" ++ }, ++ {.name = "L1D_CACHE_WB", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x15, ++ .desc = "Level 1 data cache WriteBack" ++ }, ++ {.name = "L2D_CACHE_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x16, ++ .desc = "Level 2 data cache access" ++ }, ++ {.name = "L2D_CACHE_REFILL", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x17, ++ .desc = "Level 2 data cache refill" ++ }, ++ {.name = "L2D_CACHE_WB", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x18, ++ .desc = "Level 2 data cache WriteBack" ++ }, ++ {.name = "BUS_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x19, ++ .desc = "Bus access" ++ }, ++ {.name = "LOCAL_MEMORY_ERROR", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x1a, ++ .desc = "Local memory error" ++ }, ++ {.name = "BUS_CYCLES", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x1d, ++ .desc = "Bus cycle" ++ }, ++ ++ {.name = "BUS_READ_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x60, ++ .desc = "Bus read access" ++ }, ++ {.name = "BUS_WRITE_ACCESS", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x61, ++ .desc = "Bus write access" ++ }, ++ ++ {.name = "BRANCH_SPEC_EXEC_IND", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x7a, ++ .desc = "Indirect branch speculatively executed" ++ }, ++ ++ {.name = "EXCEPTION_IRQ", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x86, ++ .desc = "Exception taken, irq" ++ }, ++ {.name = "EXCEPTION_FIQ", ++ .modmsk = ARMV8_ATTRS, ++ .code = 0x87, ++ .desc = "Exception taken, irq" ++ }, ++}; +diff --git a/lib/pfmlib_arm_armv8.c b/lib/pfmlib_arm_armv8.c +index 4bc863b..c38bd9b 100644 +--- a/lib/pfmlib_arm_armv8.c ++++ b/lib/pfmlib_arm_armv8.c +@@ -30,7 +30,8 @@ + #include "pfmlib_priv.h" /* library private */ + #include "pfmlib_arm_priv.h" + +-#include "events/arm_cortex_a57_events.h" /* event tables */ ++#include "events/arm_cortex_a57_events.h" /* A57 event tables */ ++#include "events/arm_cortex_a53_events.h" /* A53 event tables */ + + static int + pfm_arm_detect_cortex_a57(void *this) +@@ -48,6 +49,22 @@ pfm_arm_detect_cortex_a57(void *this) + return PFM_ERR_NOTSUPP; + } + ++static int ++pfm_arm_detect_cortex_a53(void *this) ++{ ++ int ret; ++ ++ ret = pfm_arm_detect(this); ++ if (ret != PFM_SUCCESS) ++ return PFM_ERR_NOTSUPP; ++ ++ if ((pfm_arm_cfg.implementer == 0x41) && /* ARM */ ++ (pfm_arm_cfg.part == 0xd03)) { /* Cortex A53 */ ++ return PFM_SUCCESS; ++ } ++ return PFM_ERR_NOTSUPP; ++} ++ + /* ARM Cortex A57 support */ + pfmlib_pmu_t arm_cortex_a57_support={ + .desc = "ARM Cortex A57", +@@ -72,3 +89,28 @@ pfmlib_pmu_t arm_cortex_a57_support={ + PFMLIB_VALID_PERF_PATTRS(pfm_arm_perf_validate_pattrs), + .get_event_nattrs = pfm_arm_get_event_nattrs, + }; ++ ++/* ARM Cortex A53 support */ ++pfmlib_pmu_t arm_cortex_a53_support={ ++ .desc = "ARM Cortex A53", ++ .name = "arm_ac53", ++ .pmu = PFM_PMU_ARM_CORTEX_A53, ++ .pme_count = LIBPFM_ARRAY_SIZE(arm_cortex_a53_pe), ++ .type = PFM_PMU_TYPE_CORE, ++ .pe = arm_cortex_a53_pe, ++ ++ .pmu_detect = pfm_arm_detect_cortex_a53, ++ .max_encoding = 1, ++ .num_cntrs = 6, ++ ++ .get_event_encoding[PFM_OS_NONE] = pfm_arm_get_encoding, ++ PFMLIB_ENCODE_PERF(pfm_arm_get_perf_encoding), ++ .get_event_first = pfm_arm_get_event_first, ++ .get_event_next = pfm_arm_get_event_next, ++ .event_is_valid = pfm_arm_event_is_valid, ++ .validate_table = pfm_arm_validate_table, ++ .get_event_info = pfm_arm_get_event_info, ++ .get_event_attr_info = pfm_arm_get_event_attr_info, ++ PFMLIB_VALID_PERF_PATTRS(pfm_arm_perf_validate_pattrs), ++ .get_event_nattrs = pfm_arm_get_event_nattrs, ++}; +diff --git a/lib/pfmlib_common.c b/lib/pfmlib_common.c +index 900d7de..ebe20da 100644 +--- a/lib/pfmlib_common.c ++++ b/lib/pfmlib_common.c +@@ -200,9 +200,11 @@ static pfmlib_pmu_t *pfmlib_pmus[]= + &arm_1176_support, + &arm_qcom_krait_support, + &arm_cortex_a57_support, ++ &arm_cortex_a53_support, + #endif + #ifdef CONFIG_PFMLIB_ARCH_ARM64 + &arm_cortex_a57_support, ++ &arm_cortex_a53_support, + #endif + + #ifdef CONFIG_PFMLIB_ARCH_S390X +diff --git a/lib/pfmlib_priv.h b/lib/pfmlib_priv.h +index 3031d3b..5678cc0 100644 +--- a/lib/pfmlib_priv.h ++++ b/lib/pfmlib_priv.h +@@ -333,6 +333,7 @@ extern pfmlib_pmu_t arm_cortex_a15_support; + extern pfmlib_pmu_t arm_1176_support; + extern pfmlib_pmu_t arm_qcom_krait_support; + extern pfmlib_pmu_t arm_cortex_a57_support; ++extern pfmlib_pmu_t arm_cortex_a53_support; + extern pfmlib_pmu_t mips_74k_support; + extern pfmlib_pmu_t s390x_cpum_cf_support; + extern pfmlib_pmu_t s390x_cpum_sf_support; +diff --git a/tests/validate_arm.c b/tests/validate_arm.c +index d6c0168..44eefd4 100644 +--- a/tests/validate_arm.c ++++ b/tests/validate_arm.c +@@ -187,6 +187,48 @@ static const test_event_t arm_test_events[]={ + .codes[0] = 0x8000008, + .fstr = "arm_ac57::INST_RETIRED:k=1:u=1:hv=0", + }, ++ { SRC_LINE, ++ .name = "arm_ac53::CPU_CYCLES", ++ .ret = PFM_SUCCESS, ++ .count = 1, ++ .codes[0] = 0x8000011, ++ .fstr = "arm_ac53::CPU_CYCLES:k=1:u=1:hv=0", ++ }, ++ { SRC_LINE, ++ .name = "arm_ac53::CPU_CYCLES:k", ++ .ret = PFM_SUCCESS, ++ .count = 1, ++ .codes[0] = 0x88000011, ++ .fstr = "arm_ac53::CPU_CYCLES:k=1:u=0:hv=0", ++ }, ++ { SRC_LINE, ++ .name = "arm_ac53::CPU_CYCLES:k:u", ++ .ret = PFM_SUCCESS, ++ .count = 1, ++ .codes[0] = 0x8000011, ++ .fstr = "arm_ac53::CPU_CYCLES:k=1:u=1:hv=0", ++ }, ++ { SRC_LINE, ++ .name = "arm_ac53::INST_RETIRED", ++ .ret = PFM_SUCCESS, ++ .count = 1, ++ .codes[0] = 0x8000008, ++ .fstr = "arm_ac53::INST_RETIRED:k=1:u=1:hv=0", ++ }, ++ { SRC_LINE, ++ .name = "arm_ac53::LD_RETIRED", ++ .ret = PFM_SUCCESS, ++ .count = 1, ++ .codes[0] = 0x8000006, ++ .fstr = "arm_ac53::LD_RETIRED:k=1:u=1:hv=0", ++ }, ++ { SRC_LINE, ++ .name = "arm_ac53::ST_RETIRED", ++ .ret = PFM_SUCCESS, ++ .count = 1, ++ .codes[0] = 0x8000007, ++ .fstr = "arm_ac53::ST_RETIRED:k=1:u=1:hv=0", ++ }, + }; + #define NUM_TEST_EVENTS (int)(sizeof(arm_test_events)/sizeof(test_event_t)) + +diff --git a/tests/validate_arm64.c b/tests/validate_arm64.c +index 0f0174c..61400ac 100644 +--- a/tests/validate_arm64.c ++++ b/tests/validate_arm64.c +@@ -72,6 +72,48 @@ static const test_event_t arm64_test_events[]={ + .codes[0] = 0x8000008, + .fstr = "arm_ac57::INST_RETIRED:k=1:u=1:hv=0", + }, ++ { SRC_LINE, ++ .name = "arm_ac53::CPU_CYCLES", ++ .ret = PFM_SUCCESS, ++ .count = 1, ++ .codes[0] = 0x8000011, ++ .fstr = "arm_ac53::CPU_CYCLES:k=1:u=1:hv=0", ++ }, ++ { SRC_LINE, ++ .name = "arm_ac53::CPU_CYCLES:k", ++ .ret = PFM_SUCCESS, ++ .count = 1, ++ .codes[0] = 0x88000011, ++ .fstr = "arm_ac53::CPU_CYCLES:k=1:u=0:hv=0", ++ }, ++ { SRC_LINE, ++ .name = "arm_ac53::CPU_CYCLES:k:u", ++ .ret = PFM_SUCCESS, ++ .count = 1, ++ .codes[0] = 0x8000011, ++ .fstr = "arm_ac53::CPU_CYCLES:k=1:u=1:hv=0", ++ }, ++ { SRC_LINE, ++ .name = "arm_ac53::INST_RETIRED", ++ .ret = PFM_SUCCESS, ++ .count = 1, ++ .codes[0] = 0x8000008, ++ .fstr = "arm_ac53::INST_RETIRED:k=1:u=1:hv=0", ++ }, ++ { SRC_LINE, ++ .name = "arm_ac53::LD_RETIRED", ++ .ret = PFM_SUCCESS, ++ .count = 1, ++ .codes[0] = 0x8000006, ++ .fstr = "arm_ac53::LD_RETIRED:k=1:u=1:hv=0", ++ }, ++ { SRC_LINE, ++ .name = "arm_ac53::ST_RETIRED", ++ .ret = PFM_SUCCESS, ++ .count = 1, ++ .codes[0] = 0x8000007, ++ .fstr = "arm_ac53::ST_RETIRED:k=1:u=1:hv=0", ++ }, + }; + #define NUM_TEST_EVENTS (int)(sizeof(arm64_test_events)/sizeof(test_event_t)) + diff --git a/libpfm.spec b/libpfm.spec index 3f6ce24..78ae034 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.5.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library to encode performance events for use by perf tool @@ -19,6 +19,7 @@ License: MIT URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz Patch12: libpfm-ac57.patch +Patch13: libpfm-ac53.patch %if %{with python} BuildRequires: python-devel @@ -64,6 +65,7 @@ Python bindings for libpfm4 and perf_event_open system call. %setup -q %patch12 -p1 +%patch13 -p1 %build %if %{with python} @@ -111,6 +113,9 @@ make \ %endif %changelog +* Fri May 23 2014 William Cohen 4.5.0-2 +- Add cortex a53 support. + * Fri May 23 2014 William Cohen 4.5.0-1 - Rebase on libpfm-4.5.0. From 684d1071990e1ac9de5663f719a79cb2139a024b Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 7 Jun 2014 00:02:12 -0500 Subject: [PATCH 20/94] - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 78ae034..a8adaa8 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.5.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Library to encode performance events for use by perf tool @@ -113,6 +113,9 @@ make \ %endif %changelog +* Sat Jun 07 2014 Fedora Release Engineering - 4.5.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + * Fri May 23 2014 William Cohen 4.5.0-2 - Add cortex a53 support. From c127adaf0873abd53f723da38d7996b456fee222 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Mon, 30 Jun 2014 13:33:14 -0700 Subject: [PATCH 21/94] Replace python-setuptools-devel BR with python-setuptools --- libpfm.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index a8adaa8..4b4e46d 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.5.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Library to encode performance events for use by perf tool @@ -23,7 +23,7 @@ Patch13: libpfm-ac53.patch %if %{with python} BuildRequires: python-devel -BuildRequires: python-setuptools-devel +BuildRequires: python-setuptools BuildRequires: swig %endif @@ -113,6 +113,9 @@ make \ %endif %changelog +* Mon Jun 30 2014 Toshio Kuratomi - 4.5.0-4 +- Replace python-setuptools-devel BR with python-setuptools + * Sat Jun 07 2014 Fedora Release Engineering - 4.5.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild From 321c481630097dcae7ad2311415825e67eca8688 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sun, 17 Aug 2014 05:25:50 +0000 Subject: [PATCH 22/94] - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 4b4e46d..fbbd247 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.5.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Library to encode performance events for use by perf tool @@ -113,6 +113,9 @@ make \ %endif %changelog +* Sun Aug 17 2014 Fedora Release Engineering - 4.5.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + * Mon Jun 30 2014 Toshio Kuratomi - 4.5.0-4 - Replace python-setuptools-devel BR with python-setuptools From 143ee83893f2e950b510f85af6def36e95a81ece Mon Sep 17 00:00:00 2001 From: William Cohen Date: Wed, 11 Feb 2015 15:30:54 -0500 Subject: [PATCH 23/94] Bump version and rebuild. --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index fbbd247..03f19d4 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.5.0 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Library to encode performance events for use by perf tool @@ -113,6 +113,9 @@ make \ %endif %changelog +* Wed Feb 11 2015 William Cohen - 4.5.0-6 +- Bump version and rebuild. + * Sun Aug 17 2014 Fedora Release Engineering - 4.5.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild From e530429c441672a7f8ddfe605ece72e197675e96 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Thu, 5 Mar 2015 14:20:43 -0500 Subject: [PATCH 24/94] Rebase to libpfm-4.6.0. --- .gitignore | 1 + libpfm-ac53.patch | 544 -------------------------- libpfm-ac57.patch | 958 ---------------------------------------------- libpfm.spec | 12 +- sources | 2 +- 5 files changed, 7 insertions(+), 1510 deletions(-) delete mode 100644 libpfm-ac53.patch delete mode 100644 libpfm-ac57.patch diff --git a/.gitignore b/.gitignore index 07ce4c1..c75660a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /libpfm-4.4.0-3.200.g9df2031.tar.gz /libpfm-4.4.0-5.217.gbca43a5.tar.gz /libpfm-4.5.0.tar.gz +/libpfm-4.6.0.tar.gz diff --git a/libpfm-ac53.patch b/libpfm-ac53.patch deleted file mode 100644 index c76251a..0000000 --- a/libpfm-ac53.patch +++ /dev/null @@ -1,544 +0,0 @@ -commit 6d1faa5bd1c0564b24cf030f118cd9782e1b4e0c -Author: Stephane Eranian -Date: Thu May 22 18:44:47 2014 +0200 - - Add missing arm_cortex_a57.h header dependency - - Was missing. We compile A57 for 32-bit arm as well. - - Signed-off-by: Stephane Eranian - -diff --git a/lib/Makefile b/lib/Makefile -index 6ca3287..585cc3e 100644 ---- a/lib/Makefile -+++ b/lib/Makefile -@@ -281,7 +281,8 @@ INC_ARM=events/arm_cortex_a8_events.h \ - INC_ARM=pfmlib_arm_priv.h \ - events/arm_cortex_a8_events.h \ - events/arm_cortex_a9_events.h \ -- events/arm_cortex_a15_events.h -+ events/arm_cortex_a15_events.h \ -+ events/arm_cortex_a57_events.h - - INC_ARM64=events/arm_cortex_a57_events.h - -commit 6af79d5186b7593c4f7e41024b78453debceb45f -Author: Stephane Eranian -Date: Thu May 22 19:14:52 2014 +0200 - - Add ARM Cortex A53 support - - This patch adds support for the ARM Cortex A53 core PMU as - documented in r0p2 version f the Cortex-A53 MPCore processor - technical reference manual Table 12.28. - - Support is provided for both 32 and 64-bit modes. - - Includes man page, and validation tests. - - Signed-off-by: Stephane Eranian - -diff --git a/README b/README -index 334c78a..e74238f 100644 ---- a/README -+++ b/README -@@ -57,6 +57,7 @@ The library supports many PMUs. The current version can handle: - ARMV7 Cortex A8 - ARMV7 Cortex A9 - ARMV7 Cortex A15 -+ ARMV8 Cortex A57, A53 - Qualcomm Krait - - - For SPARC -diff --git a/docs/Makefile b/docs/Makefile -index 9b79ec7..c7d797e 100644 ---- a/docs/Makefile -+++ b/docs/Makefile -@@ -76,11 +76,17 @@ endif - endif - - ifeq ($(CONFIG_PFMLIB_ARCH_ARM),y) --ARCH_MAN += libpfm_arm_ac57.3 libpfm_arm_ac15.3 libpfm_arm_ac8.3 libpfm_arm_ac9.3 libpfm_arm_qcom_krait.3 -+ARCH_MAN += libpfm_arm_ac57.3 \ -+ libpfm_arm_ac53.3 \ -+ libpfm_arm_ac15.3 \ -+ libpfm_arm_ac8.3 \ -+ libpfm_arm_ac9.3 \ -+ libpfm_arm_qcom_krait.3 - endif - - ifeq ($(CONFIG_PFMLIB_ARCH_ARM64),y) --ARCH_MAN += libpfm_arm_ac57.3 -+ARCH_MAN += libpfm_arm_ac57.3 \ -+ libpfm_arm_ac53.3 - endif - - ifeq ($(CONFIG_PFMLIB_ARCH_MIPS),y) -diff --git a/docs/man3/libpfm_arm_ac53.3 b/docs/man3/libpfm_arm_ac53.3 -new file mode 100644 -index 0000000..319accc ---- /dev/null -+++ b/docs/man3/libpfm_arm_ac53.3 -@@ -0,0 +1,36 @@ -+.TH LIBPFM 4 "May, 2014" "" "Linux Programmer's Manual" -+.SH NAME -+libpfm_arm_ac53 - support for ARM Cortex A53 PMU -+.SH SYNOPSIS -+.nf -+.B #include -+.sp -+.B PMU name: arm_ac53 -+.B PMU desc: ARM Cortex A53 -+.sp -+.SH DESCRIPTION -+The library supports the ARM Cortex A53 core PMU. -+ -+This PMU supports 6 counters and privilege levels filtering. -+It can operate in both 32 and 64 bit modes. -+ -+.SH MODIFIERS -+The following modifiers are supported on ARM Cortex A53: -+.TP -+.B u -+Measure at the user level. This corresponds to \fBPFM_PLM3\fR. -+This is a boolean modifier. -+.TP -+.B k -+Measure at the kernel level. This corresponds to \fBPFM_PLM0\fR. -+This is a boolean modifier. -+.TP -+.B hv -+Measure at the hypervisor level. This corresponds to \fBPFM_PLMH\fR. -+This is a boolean modifier. -+ -+.SH AUTHORS -+.nf -+Stephane Eranian -+.if -+.PP -diff --git a/include/perfmon/pfmlib.h b/include/perfmon/pfmlib.h -index b08df66..a7ec026 100644 ---- a/include/perfmon/pfmlib.h -+++ b/include/perfmon/pfmlib.h -@@ -238,6 +238,7 @@ typedef enum { - PFM_PMU_S390X_CPUM_SF, /* s390x: CPU-M sampling facility */ - - PFM_PMU_ARM_CORTEX_A57, /* ARM Cortex A57 (ARMv8) */ -+ PFM_PMU_ARM_CORTEX_A53, /* ARM Cortex A53 (ARMv8) */ - - /* MUST ADD NEW PMU MODELS HERE */ - -diff --git a/lib/Makefile b/lib/Makefile -index 585cc3e..5aaf4b3 100644 ---- a/lib/Makefile -+++ b/lib/Makefile -@@ -282,9 +282,11 @@ INC_ARM=pfmlib_arm_priv.h \ - events/arm_cortex_a8_events.h \ - events/arm_cortex_a9_events.h \ - events/arm_cortex_a15_events.h \ -- events/arm_cortex_a57_events.h -+ events/arm_cortex_a57_events.h \ -+ events/arm_cortex_a53_events.h - --INC_ARM64=events/arm_cortex_a57_events.h -+INC_ARM64=events/arm_cortex_a57_events.h \ -+ events/arm_cortex_a53_events.h - - INCDEP=$(INC_COMMON) $(INCARCH) - -diff --git a/lib/events/arm_cortex_a53_events.h b/lib/events/arm_cortex_a53_events.h -new file mode 100644 -index 0000000..c0d2bb6 ---- /dev/null -+++ b/lib/events/arm_cortex_a53_events.h -@@ -0,0 +1,190 @@ -+/* -+ * Copyright (c) 2014 Google Inc. All rights reserved -+ * Contributed by Stephane Eranian -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a copy -+ * of this software and associated documentation files (the "Software"), to deal -+ * in the Software without restriction, including without limitation the rights -+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -+ * of the Software, and to permit persons to whom the Software is furnished to do so, -+ * subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in all -+ * copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -+ * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE -+ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -+ * -+ * Cortex A53 r0p2 -+ * based on Table 12.9 from the "Cortex A53 Technical Reference Manual" -+ */ -+ -+static const arm_entry_t arm_cortex_a53_pe[]={ -+ {.name = "SW_INCR", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x00, -+ .desc = "Instruction architecturally executed (condition check pass) Software increment" -+ }, -+ {.name = "L1I_CACHE_REFILL", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x01, -+ .desc = "Level 1 instruction cache refill" -+ }, -+ {.name = "L1I_TLB_REFILL", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x02, -+ .desc = "Level 1 instruction TLB refill" -+ }, -+ {.name = "L1D_CACHE_REFILL", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x03, -+ .desc = "Level 1 data cache refill" -+ }, -+ {.name = "L1D_CACHE_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x04, -+ .desc = "Level 1 data cache access" -+ }, -+ {.name = "L1D_TLB_REFILL", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x05, -+ .desc = "Level 1 data TLB refill" -+ }, -+ {.name = "LD_RETIRED", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x06, -+ .desc = "Load Instruction architecturally executed, condition check", -+ }, -+ {.name = "ST_RETIRED", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x07, -+ .desc = "Store Instruction architecturally executed, condition check", -+ }, -+ {.name = "INST_RETIRED", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x08, -+ .desc = "Instruction architecturally executed" -+ }, -+ {.name = "EXCEPTION_TAKEN", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x09, -+ .desc = "Exception taken" -+ }, -+ {.name = "EXCEPTION_RETURN", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x0a, -+ .desc = "Instruction architecturally executed (condition check pass) Exception return" -+ }, -+ {.name = "CID_WRITE_RETIRED", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x0b, -+ .desc = "Change to Context ID retired", -+ }, -+ {.name = "PC_WRITE_RETIRED", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x0c, -+ .desc = "Write to CONTEXTIDR, instruction architecturally executed, condition check pass" -+ }, -+ {.name = "BR_IMMED_RETIRED", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x0d, -+ .desc = "Software chnage of the PC, instruction architecturally executed, condition check pass" -+ }, -+ {.name = "UNALIGNED_LDST_RETIRED", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x0f, -+ .desc = "Procedure return, instruction architecturally executed, condition check pass" -+ }, -+ {.name = "BRANCH_MISPRED", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x10, -+ .desc = "Mispredicted or not predicted branch speculatively executed" -+ }, -+ {.name = "CPU_CYCLES", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x11, -+ .desc = "Cycles" -+ }, -+ {.name = "BRANCH_PRED", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x12, -+ .desc = "Predictable branch speculatively executed" -+ }, -+ {.name = "DATA_MEM_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x13, -+ .desc = "Data memory access" -+ }, -+ {.name = "L1I_CACHE_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x14, -+ .desc = "Level 1 instruction cache access" -+ }, -+ {.name = "L1D_CACHE_WB", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x15, -+ .desc = "Level 1 data cache WriteBack" -+ }, -+ {.name = "L2D_CACHE_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x16, -+ .desc = "Level 2 data cache access" -+ }, -+ {.name = "L2D_CACHE_REFILL", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x17, -+ .desc = "Level 2 data cache refill" -+ }, -+ {.name = "L2D_CACHE_WB", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x18, -+ .desc = "Level 2 data cache WriteBack" -+ }, -+ {.name = "BUS_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x19, -+ .desc = "Bus access" -+ }, -+ {.name = "LOCAL_MEMORY_ERROR", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x1a, -+ .desc = "Local memory error" -+ }, -+ {.name = "BUS_CYCLES", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x1d, -+ .desc = "Bus cycle" -+ }, -+ -+ {.name = "BUS_READ_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x60, -+ .desc = "Bus read access" -+ }, -+ {.name = "BUS_WRITE_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x61, -+ .desc = "Bus write access" -+ }, -+ -+ {.name = "BRANCH_SPEC_EXEC_IND", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x7a, -+ .desc = "Indirect branch speculatively executed" -+ }, -+ -+ {.name = "EXCEPTION_IRQ", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x86, -+ .desc = "Exception taken, irq" -+ }, -+ {.name = "EXCEPTION_FIQ", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x87, -+ .desc = "Exception taken, irq" -+ }, -+}; -diff --git a/lib/pfmlib_arm_armv8.c b/lib/pfmlib_arm_armv8.c -index 4bc863b..c38bd9b 100644 ---- a/lib/pfmlib_arm_armv8.c -+++ b/lib/pfmlib_arm_armv8.c -@@ -30,7 +30,8 @@ - #include "pfmlib_priv.h" /* library private */ - #include "pfmlib_arm_priv.h" - --#include "events/arm_cortex_a57_events.h" /* event tables */ -+#include "events/arm_cortex_a57_events.h" /* A57 event tables */ -+#include "events/arm_cortex_a53_events.h" /* A53 event tables */ - - static int - pfm_arm_detect_cortex_a57(void *this) -@@ -48,6 +49,22 @@ pfm_arm_detect_cortex_a57(void *this) - return PFM_ERR_NOTSUPP; - } - -+static int -+pfm_arm_detect_cortex_a53(void *this) -+{ -+ int ret; -+ -+ ret = pfm_arm_detect(this); -+ if (ret != PFM_SUCCESS) -+ return PFM_ERR_NOTSUPP; -+ -+ if ((pfm_arm_cfg.implementer == 0x41) && /* ARM */ -+ (pfm_arm_cfg.part == 0xd03)) { /* Cortex A53 */ -+ return PFM_SUCCESS; -+ } -+ return PFM_ERR_NOTSUPP; -+} -+ - /* ARM Cortex A57 support */ - pfmlib_pmu_t arm_cortex_a57_support={ - .desc = "ARM Cortex A57", -@@ -72,3 +89,28 @@ pfmlib_pmu_t arm_cortex_a57_support={ - PFMLIB_VALID_PERF_PATTRS(pfm_arm_perf_validate_pattrs), - .get_event_nattrs = pfm_arm_get_event_nattrs, - }; -+ -+/* ARM Cortex A53 support */ -+pfmlib_pmu_t arm_cortex_a53_support={ -+ .desc = "ARM Cortex A53", -+ .name = "arm_ac53", -+ .pmu = PFM_PMU_ARM_CORTEX_A53, -+ .pme_count = LIBPFM_ARRAY_SIZE(arm_cortex_a53_pe), -+ .type = PFM_PMU_TYPE_CORE, -+ .pe = arm_cortex_a53_pe, -+ -+ .pmu_detect = pfm_arm_detect_cortex_a53, -+ .max_encoding = 1, -+ .num_cntrs = 6, -+ -+ .get_event_encoding[PFM_OS_NONE] = pfm_arm_get_encoding, -+ PFMLIB_ENCODE_PERF(pfm_arm_get_perf_encoding), -+ .get_event_first = pfm_arm_get_event_first, -+ .get_event_next = pfm_arm_get_event_next, -+ .event_is_valid = pfm_arm_event_is_valid, -+ .validate_table = pfm_arm_validate_table, -+ .get_event_info = pfm_arm_get_event_info, -+ .get_event_attr_info = pfm_arm_get_event_attr_info, -+ PFMLIB_VALID_PERF_PATTRS(pfm_arm_perf_validate_pattrs), -+ .get_event_nattrs = pfm_arm_get_event_nattrs, -+}; -diff --git a/lib/pfmlib_common.c b/lib/pfmlib_common.c -index 900d7de..ebe20da 100644 ---- a/lib/pfmlib_common.c -+++ b/lib/pfmlib_common.c -@@ -200,9 +200,11 @@ static pfmlib_pmu_t *pfmlib_pmus[]= - &arm_1176_support, - &arm_qcom_krait_support, - &arm_cortex_a57_support, -+ &arm_cortex_a53_support, - #endif - #ifdef CONFIG_PFMLIB_ARCH_ARM64 - &arm_cortex_a57_support, -+ &arm_cortex_a53_support, - #endif - - #ifdef CONFIG_PFMLIB_ARCH_S390X -diff --git a/lib/pfmlib_priv.h b/lib/pfmlib_priv.h -index 3031d3b..5678cc0 100644 ---- a/lib/pfmlib_priv.h -+++ b/lib/pfmlib_priv.h -@@ -333,6 +333,7 @@ extern pfmlib_pmu_t arm_cortex_a15_support; - extern pfmlib_pmu_t arm_1176_support; - extern pfmlib_pmu_t arm_qcom_krait_support; - extern pfmlib_pmu_t arm_cortex_a57_support; -+extern pfmlib_pmu_t arm_cortex_a53_support; - extern pfmlib_pmu_t mips_74k_support; - extern pfmlib_pmu_t s390x_cpum_cf_support; - extern pfmlib_pmu_t s390x_cpum_sf_support; -diff --git a/tests/validate_arm.c b/tests/validate_arm.c -index d6c0168..44eefd4 100644 ---- a/tests/validate_arm.c -+++ b/tests/validate_arm.c -@@ -187,6 +187,48 @@ static const test_event_t arm_test_events[]={ - .codes[0] = 0x8000008, - .fstr = "arm_ac57::INST_RETIRED:k=1:u=1:hv=0", - }, -+ { SRC_LINE, -+ .name = "arm_ac53::CPU_CYCLES", -+ .ret = PFM_SUCCESS, -+ .count = 1, -+ .codes[0] = 0x8000011, -+ .fstr = "arm_ac53::CPU_CYCLES:k=1:u=1:hv=0", -+ }, -+ { SRC_LINE, -+ .name = "arm_ac53::CPU_CYCLES:k", -+ .ret = PFM_SUCCESS, -+ .count = 1, -+ .codes[0] = 0x88000011, -+ .fstr = "arm_ac53::CPU_CYCLES:k=1:u=0:hv=0", -+ }, -+ { SRC_LINE, -+ .name = "arm_ac53::CPU_CYCLES:k:u", -+ .ret = PFM_SUCCESS, -+ .count = 1, -+ .codes[0] = 0x8000011, -+ .fstr = "arm_ac53::CPU_CYCLES:k=1:u=1:hv=0", -+ }, -+ { SRC_LINE, -+ .name = "arm_ac53::INST_RETIRED", -+ .ret = PFM_SUCCESS, -+ .count = 1, -+ .codes[0] = 0x8000008, -+ .fstr = "arm_ac53::INST_RETIRED:k=1:u=1:hv=0", -+ }, -+ { SRC_LINE, -+ .name = "arm_ac53::LD_RETIRED", -+ .ret = PFM_SUCCESS, -+ .count = 1, -+ .codes[0] = 0x8000006, -+ .fstr = "arm_ac53::LD_RETIRED:k=1:u=1:hv=0", -+ }, -+ { SRC_LINE, -+ .name = "arm_ac53::ST_RETIRED", -+ .ret = PFM_SUCCESS, -+ .count = 1, -+ .codes[0] = 0x8000007, -+ .fstr = "arm_ac53::ST_RETIRED:k=1:u=1:hv=0", -+ }, - }; - #define NUM_TEST_EVENTS (int)(sizeof(arm_test_events)/sizeof(test_event_t)) - -diff --git a/tests/validate_arm64.c b/tests/validate_arm64.c -index 0f0174c..61400ac 100644 ---- a/tests/validate_arm64.c -+++ b/tests/validate_arm64.c -@@ -72,6 +72,48 @@ static const test_event_t arm64_test_events[]={ - .codes[0] = 0x8000008, - .fstr = "arm_ac57::INST_RETIRED:k=1:u=1:hv=0", - }, -+ { SRC_LINE, -+ .name = "arm_ac53::CPU_CYCLES", -+ .ret = PFM_SUCCESS, -+ .count = 1, -+ .codes[0] = 0x8000011, -+ .fstr = "arm_ac53::CPU_CYCLES:k=1:u=1:hv=0", -+ }, -+ { SRC_LINE, -+ .name = "arm_ac53::CPU_CYCLES:k", -+ .ret = PFM_SUCCESS, -+ .count = 1, -+ .codes[0] = 0x88000011, -+ .fstr = "arm_ac53::CPU_CYCLES:k=1:u=0:hv=0", -+ }, -+ { SRC_LINE, -+ .name = "arm_ac53::CPU_CYCLES:k:u", -+ .ret = PFM_SUCCESS, -+ .count = 1, -+ .codes[0] = 0x8000011, -+ .fstr = "arm_ac53::CPU_CYCLES:k=1:u=1:hv=0", -+ }, -+ { SRC_LINE, -+ .name = "arm_ac53::INST_RETIRED", -+ .ret = PFM_SUCCESS, -+ .count = 1, -+ .codes[0] = 0x8000008, -+ .fstr = "arm_ac53::INST_RETIRED:k=1:u=1:hv=0", -+ }, -+ { SRC_LINE, -+ .name = "arm_ac53::LD_RETIRED", -+ .ret = PFM_SUCCESS, -+ .count = 1, -+ .codes[0] = 0x8000006, -+ .fstr = "arm_ac53::LD_RETIRED:k=1:u=1:hv=0", -+ }, -+ { SRC_LINE, -+ .name = "arm_ac53::ST_RETIRED", -+ .ret = PFM_SUCCESS, -+ .count = 1, -+ .codes[0] = 0x8000007, -+ .fstr = "arm_ac53::ST_RETIRED:k=1:u=1:hv=0", -+ }, - }; - #define NUM_TEST_EVENTS (int)(sizeof(arm64_test_events)/sizeof(test_event_t)) - diff --git a/libpfm-ac57.patch b/libpfm-ac57.patch deleted file mode 100644 index 56bd533..0000000 --- a/libpfm-ac57.patch +++ /dev/null @@ -1,958 +0,0 @@ -commit b1a3bf942376a3eaddc6f089c74bf5e322295822 -Author: Stephane Eranian -Date: Tue May 6 14:42:23 2014 +0200 - - Add ARM Cortex A57 support - - This patch adds support for ARM Cortex A57 processor - for both 64 and 32 bit modes (armv8). - - Based on Table 11-24 from the "Cortex A57 Technical Reference Manual" - - The validation tests for A57 in 64-bit mode is also added. - - Signed-off-by: Stephane Eranian - -diff --git a/config.mk b/config.mk -index 457d943..9553cbe 100644 ---- a/config.mk -+++ b/config.mk -@@ -66,6 +66,15 @@ endif - ifeq (armv7,$(findstring armv7,$(ARCH))) - override ARCH=arm - endif -+ifeq (armv7,$(findstring armv7,$(ARCH))) -+override ARCH=arm -+endif -+ifeq (aarch32,$(findstring aarch32,$(ARCH))) -+override ARCH=arm -+endif -+ifeq (armv8l,$(findstring armv8l,$(ARCH))) -+override ARCH=arm -+endif - ifeq (mips64,$(findstring mips64,$(ARCH))) - override ARCH=mips - endif -@@ -152,6 +161,14 @@ ifeq ($(ARCH),arm) - CONFIG_PFMLIB_ARCH_ARM=y - endif - -+ifeq ($(ARCH),aarch64) -+CONFIG_PFMLIB_ARCH_ARM64=y -+endif -+ -+ifeq ($(ARCH),arm64) -+CONFIG_PFMLIB_ARCH_ARM64=y -+endif -+ - ifeq ($(ARCH),s390x) - CONFIG_PFMLIB_ARCH_S390X=y - endif -diff --git a/include/perfmon/pfmlib.h b/include/perfmon/pfmlib.h -index dfdd471..b08df66 100644 ---- a/include/perfmon/pfmlib.h -+++ b/include/perfmon/pfmlib.h -@@ -237,6 +237,8 @@ typedef enum { - - PFM_PMU_S390X_CPUM_SF, /* s390x: CPU-M sampling facility */ - -+ PFM_PMU_ARM_CORTEX_A57, /* ARM Cortex A57 (ARMv8) */ -+ - /* MUST ADD NEW PMU MODELS HERE */ - - PFM_PMU_MAX /* end marker */ -diff --git a/lib/Makefile b/lib/Makefile -index 531167e..6ca3287 100644 ---- a/lib/Makefile -+++ b/lib/Makefile -@@ -139,10 +139,21 @@ SRCS += pfmlib_arm_perf_event.c - endif - - INCARCH = $(INC_ARM) --SRCS += pfmlib_arm.c pfmlib_arm_armv7_pmuv1.c pfmlib_arm_armv6.c -+SRCS += pfmlib_arm.c pfmlib_arm_armv7_pmuv1.c pfmlib_arm_armv6.c pfmlib_arm_armv8.c - CFLAGS += -DCONFIG_PFMLIB_ARCH_ARM - endif - -+ifeq ($(CONFIG_PFMLIB_ARCH_ARM64),y) -+ -+ifeq ($(SYS),Linux) -+SRCS += pfmlib_arm_perf_event.c -+endif -+ -+INCARCH = $(INC_ARM64) -+SRCS += pfmlib_arm.c pfmlib_arm_armv8.c -+CFLAGS += -DCONFIG_PFMLIB_ARCH_ARM64 -+endif -+ - ifeq ($(CONFIG_PFMLIB_ARCH_MIPS),y) - - ifeq ($(SYS),Linux) -@@ -272,6 +283,8 @@ INC_ARM=pfmlib_arm_priv.h \ - events/arm_cortex_a9_events.h \ - events/arm_cortex_a15_events.h - -+INC_ARM64=events/arm_cortex_a57_events.h -+ - INCDEP=$(INC_COMMON) $(INCARCH) - - all: $(TARGETS) -diff --git a/lib/events/arm_cortex_a57_events.h b/lib/events/arm_cortex_a57_events.h -new file mode 100644 -index 0000000..9d1d407 ---- /dev/null -+++ b/lib/events/arm_cortex_a57_events.h -@@ -0,0 +1,440 @@ -+/* -+ * Copyright (c) 2014 Google Inc. All rights reserved -+ * Contributed by Stephane Eranian -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a copy -+ * of this software and associated documentation files (the "Software"), to deal -+ * in the Software without restriction, including without limitation the rights -+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -+ * of the Software, and to permit persons to whom the Software is furnished to do so, -+ * subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in all -+ * copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -+ * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE -+ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -+ * -+ * Cortex A57 r1p1 -+ * based on Table 11-24 from the "Cortex A57 Technical Reference Manual" -+ */ -+ -+static const arm_entry_t arm_cortex_a57_pe[]={ -+ {.name = "SW_INCR", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x00, -+ .desc = "Instruction architecturally executed (condition check pass) Software increment" -+ }, -+ {.name = "L1I_CACHE_REFILL", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x01, -+ .desc = "Level 1 instruction cache refill" -+ }, -+ {.name = "L1I_TLB_REFILL", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x02, -+ .desc = "Level 1 instruction TLB refill" -+ }, -+ {.name = "L1D_CACHE_REFILL", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x03, -+ .desc = "Level 1 data cache refill" -+ }, -+ {.name = "L1D_CACHE_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x04, -+ .desc = "Level 1 data cache access" -+ }, -+ {.name = "L1D_TLB_REFILL", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x05, -+ .desc = "Level 1 data TLB refill" -+ }, -+ -+ {.name = "INST_RETIRED", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x08, -+ .desc = "Instruction architecturally executed" -+ }, -+ {.name = "EXCEPTION_TAKEN", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x09, -+ .desc = "Exception taken" -+ }, -+ {.name = "EXCEPTION_RETURN", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x0a, -+ .desc = "Instruction architecturally executed (condition check pass) Exception return" -+ }, -+ {.name = "CID_WRITE_RETIRED", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x0b, -+ .desc = "Instruction architecturally executed (condition check pass) Write to CONTEXTIDR" -+ }, -+ -+ {.name = "BRANCH_MISPRED", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x10, -+ .desc = "Mispredicted or not predicted branch speculatively executed" -+ }, -+ {.name = "CPU_CYCLES", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x11, -+ .desc = "Cycles" -+ }, -+ {.name = "BRANCH_PRED", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x12, -+ .desc = "Predictable branch speculatively executed" -+ }, -+ {.name = "DATA_MEM_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x13, -+ .desc = "Data memory access" -+ }, -+ {.name = "L1I_CACHE_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x14, -+ .desc = "Level 1 instruction cache access" -+ }, -+ {.name = "L1D_CACHE_WB", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x15, -+ .desc = "Level 1 data cache WriteBack" -+ }, -+ {.name = "L2D_CACHE_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x16, -+ .desc = "Level 2 data cache access" -+ }, -+ {.name = "L2D_CACHE_REFILL", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x17, -+ .desc = "Level 2 data cache refill" -+ }, -+ {.name = "L2D_CACHE_WB", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x18, -+ .desc = "Level 2 data cache WriteBack" -+ }, -+ {.name = "BUS_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x19, -+ .desc = "Bus access" -+ }, -+ {.name = "LOCAL_MEMORY_ERROR", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x1a, -+ .desc = "Local memory error" -+ }, -+ {.name = "INST_SPEC_EXEC", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x1b, -+ .desc = "Instruction speculatively executed" -+ }, -+ {.name = "TTBR_WRITE_RETIRED", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x1c, -+ .desc = "Instruction architecturally executed (condition check pass) Write to translation table base" -+ }, -+ {.name = "BUS_CYCLES", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x1d, -+ .desc = "Bus cycle" -+ }, -+ {.name = "L1D_READ_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x40, -+ .desc = "Level 1 data cache read access" -+ }, -+ {.name = "L1D_WRITE_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x41, -+ .desc = "Level 1 data cache write access" -+ }, -+ {.name = "L1D_READ_REFILL", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x42, -+ .desc = "Level 1 data cache read refill" -+ }, -+ {.name = "L1D_WRITE_REFILL", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x43, -+ .desc = "Level 1 data cache write refill" -+ }, -+ {.name = "L1D_WB_VICTIM", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x46, -+ .desc = "Level 1 data cache writeback victim" -+ }, -+ {.name = "L1D_WB_CLEAN_COHERENCY", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x47, -+ .desc = "Level 1 data cache writeback cleaning and coherency" -+ }, -+ {.name = "L1D_INVALIDATE", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x48, -+ .desc = "Level 1 data cache invalidate" -+ }, -+ {.name = "L1D_TLB_READ_REFILL", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x4c, -+ .desc = "Level 1 data TLB read refill" -+ }, -+ {.name = "L1D_TLB_WRITE_REFILL", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x4d, -+ .desc = "Level 1 data TLB write refill" -+ }, -+ {.name = "L2D_READ_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x50, -+ .desc = "Level 2 data cache read access" -+ }, -+ {.name = "L2D_WRITE_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x51, -+ .desc = "Level 2 data cache write access" -+ }, -+ {.name = "L2D_READ_REFILL", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x52, -+ .desc = "Level 2 data cache read refill" -+ }, -+ {.name = "L2D_WRITE_REFILL", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x53, -+ .desc = "Level 2 data cache write refill" -+ }, -+ {.name = "L2D_WB_VICTIM", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x56, -+ .desc = "Level 2 data cache writeback victim" -+ }, -+ {.name = "L2D_WB_CLEAN_COHERENCY", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x57, -+ .desc = "Level 2 data cache writeback cleaning and coherency" -+ }, -+ {.name = "L2D_INVALIDATE", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x58, -+ .desc = "Level 2 data cache invalidate" -+ }, -+ {.name = "BUS_READ_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x60, -+ .desc = "Bus read access" -+ }, -+ {.name = "BUS_WRITE_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x61, -+ .desc = "Bus write access" -+ }, -+ {.name = "BUS_NORMAL_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x62, -+ .desc = "Bus normal access" -+ }, -+ {.name = "BUS_NOT_NORMAL_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x63, -+ .desc = "Bus not normal access" -+ }, -+ {.name = "BUS_NORMAL_ACCESS_2", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x64, -+ .desc = "Bus normal access" -+ }, -+ {.name = "BUS_PERIPH_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x65, -+ .desc = "Bus peripheral access" -+ }, -+ {.name = "DATA_MEM_READ_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x66, -+ .desc = "Data memory read access" -+ }, -+ {.name = "DATA_MEM_WRITE_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x67, -+ .desc = "Data memory write access" -+ }, -+ {.name = "UNALIGNED_READ_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x68, -+ .desc = "Unaligned read access" -+ }, -+ {.name = "UNALIGNED_WRITE_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x69, -+ .desc = "Unaligned read access" -+ }, -+ {.name = "UNALIGNED_ACCESS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x6a, -+ .desc = "Unaligned access" -+ }, -+ {.name = "INST_SPEC_EXEC_LDREX", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x6c, -+ .desc = "LDREX exclusive instruction speculatively executed" -+ }, -+ {.name = "INST_SPEC_EXEC_STREX_PASS", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x6d, -+ .desc = "STREX pass exclusive instruction speculatively executed" -+ }, -+ {.name = "INST_SPEC_EXEC_STREX_FAIL", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x6e, -+ .desc = "STREX fail exclusive instruction speculatively executed" -+ }, -+ {.name = "INST_SPEC_EXEC_LOAD", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x70, -+ .desc = "Load instruction speculatively executed" -+ }, -+ {.name = "INST_SPEC_EXEC_STORE", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x71, -+ .desc = "Store instruction speculatively executed" -+ }, -+ {.name = "INST_SPEC_EXEC_LOAD_STORE", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x72, -+ .desc = "Load or store instruction speculatively executed" -+ }, -+ {.name = "INST_SPEC_EXEC_INTEGER_INST", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x73, -+ .desc = "Integer data processing instruction speculatively executed" -+ }, -+ {.name = "INST_SPEC_EXEC_SIMD", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x74, -+ .desc = "Advanced SIMD instruction speculatively executed" -+ }, -+ {.name = "INST_SPEC_EXEC_VFP", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x75, -+ .desc = "VFP instruction speculatively executed" -+ }, -+ {.name = "INST_SPEC_EXEC_SOFT_PC", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x76, -+ .desc = "Software of the PC instruction speculatively executed" -+ }, -+ {.name = "BRANCH_SPEC_EXEC_IMM_BRANCH", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x78, -+ .desc = "Immediate branch speculatively executed" -+ }, -+ {.name = "BRANCH_SPEC_EXEC_RET", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x79, -+ .desc = "Return branch speculatively executed" -+ }, -+ {.name = "BRANCH_SPEC_EXEC_IND", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x7a, -+ .desc = "Indirect branch speculatively executed" -+ }, -+ {.name = "BARRIER_SPEC_EXEC_ISB", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x7c, -+ .desc = "ISB barrier speculatively executed" -+ }, -+ {.name = "BARRIER_SPEC_EXEC_DSB", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x7d, -+ .desc = "DSB barrier speculatively executed" -+ }, -+ {.name = "BARRIER_SPEC_EXEC_DMB", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x7e, -+ .desc = "DMB barrier speculatively executed" -+ }, -+ {.name = "EXCEPTION_UNDEF", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x81, -+ .desc = "Exception taken, other synchronous" -+ }, -+ {.name = "EXCEPTION_SVC", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x82, -+ .desc = "Exception taken, supervisor call" -+ }, -+ {.name = "EXCEPTION_PABORT", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x83, -+ .desc = "Exception taken, instruction abort" -+ }, -+ {.name = "EXCEPTION_DABORT", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x84, -+ .desc = "Exception taken, data abort or SError" -+ }, -+ {.name = "EXCEPTION_IRQ", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x86, -+ .desc = "Exception taken, irq" -+ }, -+ {.name = "EXCEPTION_FIQ", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x87, -+ .desc = "Exception taken, irq" -+ }, -+ {.name = "EXCEPTION_SMC", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x88, -+ .desc = "Exception taken, secure monitor call" -+ }, -+ {.name = "EXCEPTION_HVC", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x8a, -+ .desc = "Exception taken, hypervisor call" -+ }, -+ {.name = "EXCEPTION_TRAP_PABORT", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x8b, -+ .desc = "Exception taken, instruction abort not taken locally" -+ }, -+ {.name = "EXCEPTION_TRAP_DABORT", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x8c, -+ .desc = "Exception taken, data abort or SError not taken locally" -+ }, -+ {.name = "EXCEPTION_TRAP_OTHER", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x8d, -+ .desc = "Exception taken, other traps not taken locally" -+ }, -+ {.name = "EXCEPTION_TRAP_IRQ", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x8e, -+ .desc = "Exception taken, irq not taken locally" -+ }, -+ {.name = "EXCEPTION_TRAP_FIQ", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x8f, -+ .desc = "Exception taken, fiq not taken locally" -+ }, -+ {.name = "RC_LD_SPEC", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x90, -+ .desc = "Release consistency instruction speculatively executed (load-acquire)", -+ }, -+ {.name = "RC_ST_SPEC", -+ .modmsk = ARMV8_ATTRS, -+ .code = 0x91, -+ .desc = "Release consistency instruction speculatively executed (store-release)", -+ }, -+ /* END Cortex A47 specific events */ -+}; -diff --git a/lib/pfmlib_arm_armv8.c b/lib/pfmlib_arm_armv8.c -new file mode 100644 -index 0000000..880d566 ---- /dev/null -+++ b/lib/pfmlib_arm_armv8.c -@@ -0,0 +1,74 @@ -+/* -+ * pfmlib_arm_armv8.c : support for ARMv8 processors -+ * -+ * Copyright (c) 2014 Google Inc. All rights reserved -+ * Contributed by Stephane Eranian -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a copy -+ * of this software and associated documentation files (the "Software"), to deal -+ * in the Software without restriction, including without limitation the rights -+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -+ * of the Software, and to permit persons to whom the Software is furnished to do so, -+ * subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in all -+ * copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -+ * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE -+ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -+ * -+ */ -+#include -+#include -+#include -+ -+/* private headers */ -+#include "pfmlib_priv.h" /* library private */ -+#include "pfmlib_arm_priv.h" -+ -+#include "events/arm_cortex_a57_events.h" /* event tables */ -+ -+static int -+pfm_arm_detect_cortex_a57(void *this) -+{ -+ int ret; -+ -+ ret = pfm_arm_detect(this); -+ if (ret != PFM_SUCCESS) -+ return PFM_ERR_NOTSUPP; -+ -+ if ((pfm_arm_cfg.implementer == 0x41) && /* ARM */ -+ (pfm_arm_cfg.part == 0xc00)) { /* Cortex A57 */ -+ return PFM_SUCCESS; -+ } -+ return PFM_ERR_NOTSUPP; -+} -+ -+/* ARM Cortex A57 support */ -+pfmlib_pmu_t arm_cortex_a57_support={ -+ .desc = "ARM Cortex A57", -+ .name = "arm_ac57", -+ .pmu = PFM_PMU_ARM_CORTEX_A57, -+ .pme_count = LIBPFM_ARRAY_SIZE(arm_cortex_a57_pe), -+ .type = PFM_PMU_TYPE_CORE, -+ .pe = arm_cortex_a57_pe, -+ -+ .pmu_detect = pfm_arm_detect_cortex_a57, -+ .max_encoding = 1, -+ .num_cntrs = 6, -+ -+ .get_event_encoding[PFM_OS_NONE] = pfm_arm_get_encoding, -+ PFMLIB_ENCODE_PERF(pfm_arm_get_perf_encoding), -+ .get_event_first = pfm_arm_get_event_first, -+ .get_event_next = pfm_arm_get_event_next, -+ .event_is_valid = pfm_arm_event_is_valid, -+ .validate_table = pfm_arm_validate_table, -+ .get_event_info = pfm_arm_get_event_info, -+ .get_event_attr_info = pfm_arm_get_event_attr_info, -+ PFMLIB_VALID_PERF_PATTRS(pfm_arm_perf_validate_pattrs), -+ .get_event_nattrs = pfm_arm_get_event_nattrs, -+}; -diff --git a/lib/pfmlib_arm_priv.h b/lib/pfmlib_arm_priv.h -index ef367b7..227508b 100644 ---- a/lib/pfmlib_arm_priv.h -+++ b/lib/pfmlib_arm_priv.h -@@ -86,6 +86,9 @@ extern int pfm_arm_get_perf_encoding(void *this, pfmlib_event_desc_t *e); - #define ARMV7_A15_ATTRS (_ARM_ATTR_K|_ARM_ATTR_U|_ARM_ATTR_HV) - #define ARMV7_A15_PLM (PFM_PLM0|PFM_PLM3|PFM_PLMH) - -+#define ARMV8_ATTRS (_ARM_ATTR_K|_ARM_ATTR_U|_ARM_ATTR_HV) -+#define ARMV8_PLM (PFM_PLM0|PFM_PLM3|PFM_PLMH) -+ - static inline int - arm_has_plm(void *this, pfmlib_event_desc_t *e) - { -diff --git a/lib/pfmlib_common.c b/lib/pfmlib_common.c -index 8e4b1a1..900d7de 100644 ---- a/lib/pfmlib_common.c -+++ b/lib/pfmlib_common.c -@@ -199,7 +199,12 @@ static pfmlib_pmu_t *pfmlib_pmus[]= - &arm_cortex_a15_support, - &arm_1176_support, - &arm_qcom_krait_support, -+ &arm_cortex_a57_support, - #endif -+#ifdef CONFIG_PFMLIB_ARCH_ARM64 -+ &arm_cortex_a57_support, -+#endif -+ - #ifdef CONFIG_PFMLIB_ARCH_S390X - &s390x_cpum_cf_support, - &s390x_cpum_sf_support, -diff --git a/lib/pfmlib_priv.h b/lib/pfmlib_priv.h -index 715c4b0..3031d3b 100644 ---- a/lib/pfmlib_priv.h -+++ b/lib/pfmlib_priv.h -@@ -332,6 +332,7 @@ extern pfmlib_pmu_t arm_cortex_a9_support; - extern pfmlib_pmu_t arm_cortex_a15_support; - extern pfmlib_pmu_t arm_1176_support; - extern pfmlib_pmu_t arm_qcom_krait_support; -+extern pfmlib_pmu_t arm_cortex_a57_support; - extern pfmlib_pmu_t mips_74k_support; - extern pfmlib_pmu_t s390x_cpum_cf_support; - extern pfmlib_pmu_t s390x_cpum_sf_support; -diff --git a/tests/Makefile b/tests/Makefile -index 7076fb7..7dd82c3 100644 ---- a/tests/Makefile -+++ b/tests/Makefile -@@ -39,6 +39,10 @@ ifeq ($(CONFIG_PFMLIB_ARCH_ARM),y) - SRCS += validate_arm.c - endif - -+ifeq ($(CONFIG_PFMLIB_ARCH_ARM64),y) -+SRCS += validate_arm64.c -+endif -+ - ifeq ($(CONFIG_PFMLIB_ARCH_POWERPC),y) - SRCS += validate_power.c - endif -diff --git a/tests/validate_arm.c b/tests/validate_arm.c -index fe97aa9..d6c0168 100644 ---- a/tests/validate_arm.c -+++ b/tests/validate_arm.c -@@ -159,6 +159,34 @@ static const test_event_t arm_test_events[]={ - .codes[0] = 0x480000ff, - .fstr = "qcom_krait::CPU_CYCLES:k=0:u=1:hv=0", - }, -+ { SRC_LINE, -+ .name = "arm_ac57::CPU_CYCLES", -+ .ret = PFM_SUCCESS, -+ .count = 1, -+ .codes[0] = 0x8000011, -+ .fstr = "arm_ac57::CPU_CYCLES:k=1:u=1:hv=0", -+ }, -+ { SRC_LINE, -+ .name = "arm_ac57::CPU_CYCLES:k", -+ .ret = PFM_SUCCESS, -+ .count = 1, -+ .codes[0] = 0x88000011, -+ .fstr = "arm_ac57::CPU_CYCLES:k=1:u=0:hv=0", -+ }, -+ { SRC_LINE, -+ .name = "arm_ac57::CPU_CYCLES:k:u", -+ .ret = PFM_SUCCESS, -+ .count = 1, -+ .codes[0] = 0x8000011, -+ .fstr = "arm_ac57::CPU_CYCLES:k=1:u=1:hv=0", -+ }, -+ { SRC_LINE, -+ .name = "arm_ac57::INST_RETIRED", -+ .ret = PFM_SUCCESS, -+ .count = 1, -+ .codes[0] = 0x8000008, -+ .fstr = "arm_ac57::INST_RETIRED:k=1:u=1:hv=0", -+ }, - }; - #define NUM_TEST_EVENTS (int)(sizeof(arm_test_events)/sizeof(test_event_t)) - -diff --git a/tests/validate_arm64.c b/tests/validate_arm64.c -new file mode 100644 -index 0000000..0f0174c ---- /dev/null -+++ b/tests/validate_arm64.c -@@ -0,0 +1,138 @@ -+/* -+ * validate_arm64.c - validate ARM64 event tables + encodings -+ * -+ * Copyright (c) 2014 Google, Inc -+ * Contributed by Stephane Eranian -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a copy -+ * of this software and associated documentation files (the "Software"), to deal -+ * in the Software without restriction, including without limitation the rights -+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -+ * of the Software, and to permit persons to whom the Software is furnished to do so, -+ * subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in all -+ * copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -+ * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE -+ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -+ * -+ */ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+#define MAX_ENCODING 1 -+#define SRC_LINE .line = __LINE__ -+ -+typedef struct { -+ const char *name; -+ const char *fstr; -+ uint64_t codes[MAX_ENCODING]; -+ int ret, count, line; -+} test_event_t; -+ -+static const test_event_t arm64_test_events[]={ -+ { SRC_LINE, -+ .name = "arm_ac57::CPU_CYCLES", -+ .ret = PFM_SUCCESS, -+ .count = 1, -+ .codes[0] = 0x8000011, -+ .fstr = "arm_ac57::CPU_CYCLES:k=1:u=1:hv=0", -+ }, -+ { SRC_LINE, -+ .name = "arm_ac57::CPU_CYCLES:k", -+ .ret = PFM_SUCCESS, -+ .count = 1, -+ .codes[0] = 0x88000011, -+ .fstr = "arm_ac57::CPU_CYCLES:k=1:u=0:hv=0", -+ }, -+ { SRC_LINE, -+ .name = "arm_ac57::CPU_CYCLES:k:u", -+ .ret = PFM_SUCCESS, -+ .count = 1, -+ .codes[0] = 0x8000011, -+ .fstr = "arm_ac57::CPU_CYCLES:k=1:u=1:hv=0", -+ }, -+ { SRC_LINE, -+ .name = "arm_ac57::INST_RETIRED", -+ .ret = PFM_SUCCESS, -+ .count = 1, -+ .codes[0] = 0x8000008, -+ .fstr = "arm_ac57::INST_RETIRED:k=1:u=1:hv=0", -+ }, -+}; -+#define NUM_TEST_EVENTS (int)(sizeof(arm64_test_events)/sizeof(test_event_t)) -+ -+static int check_test_events(FILE *fp) -+{ -+ const test_event_t *e; -+ char *fstr; -+ uint64_t *codes; -+ int count, i, j; -+ int ret, errors = 0; -+ -+ for (i = 0, e = arm64_test_events; i < NUM_TEST_EVENTS; i++, e++) { -+ codes = NULL; -+ count = 0; -+ fstr = NULL; -+ ret = pfm_get_event_encoding(e->name, PFM_PLM0 | PFM_PLM3, &fstr, NULL, &codes, &count); -+ if (ret != e->ret) { -+ fprintf(fp,"Line %d, Event%d %s, ret=%s(%d) expected %s(%d)\n", e->line, i, e->name, pfm_strerror(ret), ret, pfm_strerror(e->ret), e->ret); -+ errors++; -+ } else { -+ if (ret != PFM_SUCCESS) { -+ if (fstr) { -+ fprintf(fp,"Line %d, Event%d %s, expected fstr NULL but it is not\n", e->line, i, e->name); -+ errors++; -+ } -+ if (count != 0) { -+ fprintf(fp,"Line %d, Event%d %s, expected count=0 instead of %d\n", e->line, i, e->name, count); -+ errors++; -+ } -+ if (codes) { -+ fprintf(fp,"Line %d, Event%d %s, expected codes[] NULL but it is not\n", e->line, i, e->name); -+ errors++; -+ } -+ } else { -+ if (count != e->count) { -+ fprintf(fp,"Line %d, Event%d %s, count=%d expected %d\n", e->line, i, e->name, count, e->count); -+ errors++; -+ } -+ for (j=0; j < count; j++) { -+ if (codes[j] != e->codes[j]) { -+ fprintf(fp,"Line %d, Event%d %s, codes[%d]=%#"PRIx64" expected %#"PRIx64"\n", e->line, i, e->name, j, codes[j], e->codes[j]); -+ errors++; -+ } -+ } -+ if (e->fstr && strcmp(fstr, e->fstr)) { -+ fprintf(fp,"Line %d, Event%d %s, fstr=%s expected %s\n", e->line, i, e->name, fstr, e->fstr); -+ errors++; -+ } -+ } -+ } -+ if (codes) -+ free(codes); -+ if (fstr) -+ free(fstr); -+ } -+ printf("\t %d ARM64 events: %d errors\n", i, errors); -+ return errors; -+} -+ -+int -+validate_arch(FILE *fp) -+{ -+ return check_test_events(fp); -+} -commit b95de18085dd74738752341e0004b3dd11f00a53 -Author: Stephane Eranian -Date: Mon May 12 14:15:57 2014 +0200 - - Add ARM Cortex A57 documentation - - Signed-off-by: Stephane Eranian - -diff --git a/docs/Makefile b/docs/Makefile -index ecf6769..9b79ec7 100644 ---- a/docs/Makefile -+++ b/docs/Makefile -@@ -76,7 +76,11 @@ endif - endif - - ifeq ($(CONFIG_PFMLIB_ARCH_ARM),y) --ARCH_MAN += libpfm_arm_ac15.3 libpfm_arm_ac8.3 libpfm_arm_ac9.3 libpfm_arm_qcom_krait.3 -+ARCH_MAN += libpfm_arm_ac57.3 libpfm_arm_ac15.3 libpfm_arm_ac8.3 libpfm_arm_ac9.3 libpfm_arm_qcom_krait.3 -+endif -+ -+ifeq ($(CONFIG_PFMLIB_ARCH_ARM64),y) -+ARCH_MAN += libpfm_arm_ac57.3 - endif - - ifeq ($(CONFIG_PFMLIB_ARCH_MIPS),y) -diff --git a/docs/man3/libpfm_arm_ac57.3 b/docs/man3/libpfm_arm_ac57.3 -new file mode 100644 -index 0000000..c471ff1 ---- /dev/null -+++ b/docs/man3/libpfm_arm_ac57.3 -@@ -0,0 +1,36 @@ -+.TH LIBPFM 4 "May, 2014" "" "Linux Programmer's Manual" -+.SH NAME -+libpfm_arm_ac57 - support for Arm Cortex A57 PMU -+.SH SYNOPSIS -+.nf -+.B #include -+.sp -+.B PMU name: arm_ac57 -+.B PMU desc: ARM Cortex A57 -+.sp -+.SH DESCRIPTION -+The library supports the ARM Cortex A57 core PMU. -+ -+This PMU supports 6 counters and privilege levels filtering. -+It can operate in both 32 and 64 bit modes. -+ -+.SH MODIFIERS -+The following modifiers are supported on ARM Cortex A57: -+.TP -+.B u -+Measure at the user level. This corresponds to \fBPFM_PLM3\fR. -+This is a boolean modifier. -+.TP -+.B k -+Measure at the kernel level. This corresponds to \fBPFM_PLM0\fR. -+This is a boolean modifier. -+.TP -+.B hv -+Measure at the hypervisor level. This corresponds to \fBPFM_PLMH\fR. -+This is a boolean modifier. -+ -+.SH AUTHORS -+.nf -+Stephane Eranian -+.if -+.PP -commit 399aa947ca6f4c58acac8c6be52d2ad4e5268210 -Author: Stephane Eranian -Date: Fri May 16 15:42:40 2014 +0200 - - fix the ARM Cortex A57 detection - - This patch fixes the detection of ARM Cortex A57. - Was using the wrong part number. Correct number - is 0xD07. - - Signed-off-by: Stephane Eranian - -diff --git a/lib/pfmlib_arm_armv8.c b/lib/pfmlib_arm_armv8.c -index 880d566..4bc863b 100644 ---- a/lib/pfmlib_arm_armv8.c -+++ b/lib/pfmlib_arm_armv8.c -@@ -42,7 +42,7 @@ pfm_arm_detect_cortex_a57(void *this) - return PFM_ERR_NOTSUPP; - - if ((pfm_arm_cfg.implementer == 0x41) && /* ARM */ -- (pfm_arm_cfg.part == 0xc00)) { /* Cortex A57 */ -+ (pfm_arm_cfg.part == 0xd07)) { /* Cortex A57 */ - return PFM_SUCCESS; - } - return PFM_ERR_NOTSUPP; diff --git a/libpfm.spec b/libpfm.spec index 03f19d4..a4b12bd 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,8 +9,8 @@ %endif Name: libpfm -Version: 4.5.0 -Release: 6%{?dist} +Version: 4.6.0 +Release: 1%{?dist} Summary: Library to encode performance events for use by perf tool @@ -18,8 +18,6 @@ Group: System Environment/Libraries License: MIT URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz -Patch12: libpfm-ac57.patch -Patch13: libpfm-ac53.patch %if %{with python} BuildRequires: python-devel @@ -64,9 +62,6 @@ Python bindings for libpfm4 and perf_event_open system call. %prep %setup -q -%patch12 -p1 -%patch13 -p1 - %build %if %{with python} %global python_config CONFIG_PFMLIB_NOPYTHON=n @@ -113,6 +108,9 @@ make \ %endif %changelog +* Thu Mar 5 2015 William Cohen - 4.6.0-1 +- Rebase on libpfm-4.6.0. + * Wed Feb 11 2015 William Cohen - 4.5.0-6 - Bump version and rebuild. diff --git a/sources b/sources index 38403e0..6f351e8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -8eda1e3741c8f3359a33ebd553243333 libpfm-4.5.0.tar.gz +5077b9022440e4951d96f2d0e73bd487 libpfm-4.6.0.tar.gz From 25c704b8ff701f9bf5711776b5e5e7e52a05e93e Mon Sep 17 00:00:00 2001 From: William Cohen Date: Thu, 4 Jun 2015 13:53:35 -0400 Subject: [PATCH 25/94] Make sure subrpms have same version as main libpfm rpm. --- libpfm.spec | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index a4b12bd..84037f3 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.6.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library to encode performance events for use by perf tool @@ -34,7 +34,7 @@ for the perf_events interface available in upstream Linux kernels since v2.6.31. %package devel Summary: Development library to encode performance events for perf_events based tools Group: Development/Libraries -Requires: %{name}%{?_isa} = %{version} +Requires: %{name}%{?_isa} = %{version}-%{release} %description devel Development library and header files to create performance monitoring @@ -43,7 +43,7 @@ applications for the perf_events interface. %package static Summary: Static library to encode performance events for perf_events based tools Group: Development/Libraries -Requires: %{name}%{?_isa} = %{version} +Requires: %{name}%{?_isa} = %{version}-%{release} %description static Static version of the libpfm library for performance monitoring @@ -53,7 +53,7 @@ applications for the perf_events interface. %package python Summary: Python bindings for libpfm and perf_event_open system call Group: Development/Languages -Requires: %{name}%{?_isa} = %{version} +Requires: %{name}%{?_isa} = %{version}-%{release} %description python Python bindings for libpfm4 and perf_event_open system call. @@ -108,6 +108,9 @@ make \ %endif %changelog +* Thu Jun 4 2015 William Cohen - 4.6.0-2 +- Correct requires for subpackages. + * Thu Mar 5 2015 William Cohen - 4.6.0-1 - Rebase on libpfm-4.6.0. From a25bed8d76b03794e611a6197d595092866cf2c2 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 17 Jun 2015 16:22:49 +0000 Subject: [PATCH 26/94] - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 84037f3..9fd02c9 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.6.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Library to encode performance events for use by perf tool @@ -108,6 +108,9 @@ make \ %endif %changelog +* Wed Jun 17 2015 Fedora Release Engineering - 4.6.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + * Thu Jun 4 2015 William Cohen - 4.6.0-2 - Correct requires for subpackages. From 4c403f530834b6a74d4345edc2d0aae452e14015 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 4 Feb 2016 03:45:17 +0000 Subject: [PATCH 27/94] - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 9fd02c9..f03348f 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.6.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Library to encode performance events for use by perf tool @@ -108,6 +108,9 @@ make \ %endif %changelog +* Thu Feb 04 2016 Fedora Release Engineering - 4.6.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + * Wed Jun 17 2015 Fedora Release Engineering - 4.6.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild From 01f234c66ca636fc2446e70ab95e70d1b2403314 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Thu, 11 Feb 2016 13:39:54 -0500 Subject: [PATCH 28/94] Rebase on libpfm-4.7.0. --- .gitignore | 1 + libpfm.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index c75660a..b7d5276 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /libpfm-4.4.0-5.217.gbca43a5.tar.gz /libpfm-4.5.0.tar.gz /libpfm-4.6.0.tar.gz +/libpfm-4.7.0.tar.gz diff --git a/libpfm.spec b/libpfm.spec index f03348f..d81ede0 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,8 +9,8 @@ %endif Name: libpfm -Version: 4.6.0 -Release: 4%{?dist} +Version: 4.7.0 +Release: 1%{?dist} Summary: Library to encode performance events for use by perf tool @@ -108,6 +108,9 @@ make \ %endif %changelog +* Thu Feb 11 2016 William Cohen - 4.7.0-1 +- Rebase on libpfm-4.7.0. + * Thu Feb 04 2016 Fedora Release Engineering - 4.6.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild diff --git a/sources b/sources index 6f351e8..dcd270d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -5077b9022440e4951d96f2d0e73bd487 libpfm-4.6.0.tar.gz +44c171be724e3945b6b587c20d27a3fa libpfm-4.7.0.tar.gz From 29a46f810486d914746dba3dac86fb6b7a66f43a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 19 Jul 2016 07:43:04 +0000 Subject: [PATCH 29/94] - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index d81ede0..39ae958 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.7.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library to encode performance events for use by perf tool @@ -108,6 +108,9 @@ make \ %endif %changelog +* Tue Jul 19 2016 Fedora Release Engineering - 4.7.0-2 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + * Thu Feb 11 2016 William Cohen - 4.7.0-1 - Rebase on libpfm-4.7.0. From 033c6fd25c94f68c972c30c564dd52c873e92b8a Mon Sep 17 00:00:00 2001 From: William Cohen Date: Mon, 7 Nov 2016 11:12:28 -0500 Subject: [PATCH 30/94] Rebase on libpfm-4.8.0. --- .gitignore | 1 + libpfm.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b7d5276..0da00a7 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /libpfm-4.5.0.tar.gz /libpfm-4.6.0.tar.gz /libpfm-4.7.0.tar.gz +/libpfm-4.8.0.tar.gz diff --git a/libpfm.spec b/libpfm.spec index 39ae958..a0e91ea 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,7 +9,7 @@ %endif Name: libpfm -Version: 4.7.0 +Version: 4.8.0 Release: 2%{?dist} Summary: Library to encode performance events for use by perf tool @@ -108,6 +108,9 @@ make \ %endif %changelog +* Mon Nov 7 2016 William Cohen - 4.8.0-1 +- Rebase on libpfm-4.8.0. + * Tue Jul 19 2016 Fedora Release Engineering - 4.7.0-2 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages diff --git a/sources b/sources index dcd270d..00d131c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -44c171be724e3945b6b587c20d27a3fa libpfm-4.7.0.tar.gz +730383896db92e12fb2cc10f2d41dd43 libpfm-4.8.0.tar.gz From 4867e1344e06b3d761c7931f88610ad4c33079ac Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 10 Feb 2017 19:16:31 +0000 Subject: [PATCH 31/94] - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index a0e91ea..4c59938 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.8.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Library to encode performance events for use by perf tool @@ -108,6 +108,9 @@ make \ %endif %changelog +* Fri Feb 10 2017 Fedora Release Engineering - 4.8.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + * Mon Nov 7 2016 William Cohen - 4.8.0-1 - Rebase on libpfm-4.8.0. From b00e6540d3a05b79d6ff17bc19fdb2478353d0fc Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Fri, 7 Jul 2017 12:21:13 +0200 Subject: [PATCH 32/94] Rebuild due to bug in RPM (RHBZ #1468476) Signed-off-by: Igor Gnatenko --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 4c59938..41f08be 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.8.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Library to encode performance events for use by perf tool @@ -108,6 +108,9 @@ make \ %endif %changelog +* Fri Jul 07 2017 Igor Gnatenko - 4.8.0-4 +- Rebuild due to bug in RPM (RHBZ #1468476) + * Fri Feb 10 2017 Fedora Release Engineering - 4.8.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild From 5059dba16747f30017314b52b6a037465d5710bc Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 26 Jul 2017 19:31:15 +0000 Subject: [PATCH 33/94] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 41f08be..ade969f 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.8.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Library to encode performance events for use by perf tool @@ -108,6 +108,9 @@ make \ %endif %changelog +* Wed Jul 26 2017 Fedora Release Engineering - 4.8.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + * Fri Jul 07 2017 Igor Gnatenko - 4.8.0-4 - Rebuild due to bug in RPM (RHBZ #1468476) From 91533d7a468d60404b991947b6b683c571667b73 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 3 Aug 2017 02:05:00 +0000 Subject: [PATCH 34/94] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index ade969f..336648d 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.8.0 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Library to encode performance events for use by perf tool @@ -108,6 +108,9 @@ make \ %endif %changelog +* Thu Aug 03 2017 Fedora Release Engineering - 4.8.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + * Wed Jul 26 2017 Fedora Release Engineering - 4.8.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild From 557d7065fbc47ed5dd9fe66e51c8f8da8d53a36e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 19 Aug 2017 09:38:38 -0400 Subject: [PATCH 35/94] Python 2 binary package renamed to python2-libpfm --- libpfm.spec | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index 336648d..f35c721 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.8.0 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Library to encode performance events for use by perf tool @@ -50,12 +50,16 @@ Static version of the libpfm library for performance monitoring applications for the perf_events interface. %if %{with python} -%package python +%package -n python2-libpfm +%{?python_provide:%python_provide python2-libpfm} +# Remove before F30 +Provides: %{name}-python%{?_isa} = %{version}-%{release} +Obsoletes: %{name}-python < %{version}-%{release} Summary: Python bindings for libpfm and perf_event_open system call Group: Development/Languages Requires: %{name}%{?_isa} = %{version}-%{release} -%description python +%description -n python2-libpfm Python bindings for libpfm4 and perf_event_open system call. %endif @@ -103,11 +107,15 @@ make \ %{_libdir}/lib*.a %if %{with python} -%files python +%files -n python2-libpfm %{python_sitearch}/* %endif %changelog +* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek - 4.8.0-7 +- Python 2 binary package renamed to python2-libpfm + See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3 + * Thu Aug 03 2017 Fedora Release Engineering - 4.8.0-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild From f7b910a2823da243f3dc31ec6036fe5d94129373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 20 Aug 2017 10:36:50 -0400 Subject: [PATCH 36/94] Add Provides for the old name without %_isa --- libpfm.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index f35c721..a13b460 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.8.0 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Library to encode performance events for use by perf tool @@ -53,6 +53,7 @@ applications for the perf_events interface. %package -n python2-libpfm %{?python_provide:%python_provide python2-libpfm} # Remove before F30 +Provides: %{name}-python = %{version}-%{release} Provides: %{name}-python%{?_isa} = %{version}-%{release} Obsoletes: %{name}-python < %{version}-%{release} Summary: Python bindings for libpfm and perf_event_open system call @@ -112,6 +113,9 @@ make \ %endif %changelog +* Sun Aug 20 2017 Zbigniew Jędrzejewski-Szmek - 4.8.0-8 +- Add Provides for the old name without %%_isa + * Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek - 4.8.0-7 - Python 2 binary package renamed to python2-libpfm See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3 From 37725593f352cd421fabf1a149b7396f87680303 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Thu, 4 Jan 2018 09:01:59 -0500 Subject: [PATCH 37/94] Rebase on libpfm-4.9.0. --- .gitignore | 1 + libpfm.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 0da00a7..abfa124 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /libpfm-4.6.0.tar.gz /libpfm-4.7.0.tar.gz /libpfm-4.8.0.tar.gz +/libpfm-4.9.0.tar.gz diff --git a/libpfm.spec b/libpfm.spec index a13b460..216d457 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,8 +9,8 @@ %endif Name: libpfm -Version: 4.8.0 -Release: 8%{?dist} +Version: 4.9.0 +Release: 1%{?dist} Summary: Library to encode performance events for use by perf tool @@ -113,6 +113,9 @@ make \ %endif %changelog +* Thu Jan 4 2018 William Cohen - 4.9.0-1 +- Rebase on libpfm-4.9.0. + * Sun Aug 20 2017 Zbigniew Jędrzejewski-Szmek - 4.8.0-8 - Add Provides for the old name without %%_isa diff --git a/sources b/sources index 00d131c..41e74a5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -730383896db92e12fb2cc10f2d41dd43 libpfm-4.8.0.tar.gz +SHA512 (libpfm-4.9.0.tar.gz) = 9e62556a5e8029b94383bd54176c5171fec7f919b6826d5d348837540922874c922eb0e01d7835c388ae28809c798f4b3da8ba751777767ce4a0e47ddab2b645 From d5efe98c8d612e91c43470389e932fe8368d54f4 Mon Sep 17 00:00:00 2001 From: Iryna Shcherbina Date: Tue, 9 Jan 2018 18:57:30 +0100 Subject: [PATCH 38/94] Update Python 2 dependency declarations to new packaging standards --- libpfm.spec | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index 216d457..f372ee1 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.9.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library to encode performance events for use by perf tool @@ -20,8 +20,8 @@ URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz %if %{with python} -BuildRequires: python-devel -BuildRequires: python-setuptools +BuildRequires: python2-devel +BuildRequires: python2-setuptools BuildRequires: swig %endif @@ -113,6 +113,10 @@ make \ %endif %changelog +* Tue Jan 09 2018 Iryna Shcherbina - 4.9.0-2 +- Update Python 2 dependency declarations to new packaging standards + (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) + * Thu Jan 4 2018 William Cohen - 4.9.0-1 - Rebase on libpfm-4.9.0. From b3bd2d418d1ad54ef43214c7da31e5be24b0bbed Mon Sep 17 00:00:00 2001 From: William Cohen Date: Tue, 30 Jan 2018 13:57:18 -0500 Subject: [PATCH 39/94] Related: rhbz1540262 --- libpfm.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index f372ee1..eb0ed58 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.9.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Library to encode performance events for use by perf tool @@ -73,7 +73,8 @@ Python bindings for libpfm4 and perf_event_open system call. %else %global python_config CONFIG_PFMLIB_NOPYTHON=y %endif -make %{python_config} %{?_smp_mflags} +make %{python_config} %{?_smp_mflags} \ + OPTIM="%{optflags}" %install @@ -113,6 +114,9 @@ make \ %endif %changelog +* Tue Jan 30 2018 William Cohen - 4.9.0-3 +- Use the RPM build flags. (RHBZ #1540262) + * Tue Jan 09 2018 Iryna Shcherbina - 4.9.0-2 - Update Python 2 dependency declarations to new packaging standards (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) From c307e8c48d339bd470e4ddb410af065c46e51fe2 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Wed, 31 Jan 2018 11:47:46 -0500 Subject: [PATCH 40/94] Fixes due to compiler checks for possible truncation by snprintf. --- libpfm-truncation.patch | 85 +++++++++++++++++++++++++++++++++++++++++ libpfm.spec | 7 +++- 2 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 libpfm-truncation.patch diff --git a/libpfm-truncation.patch b/libpfm-truncation.patch new file mode 100644 index 0000000..99170f3 --- /dev/null +++ b/libpfm-truncation.patch @@ -0,0 +1,85 @@ +diff --git a/lib/pfmlib_perf_event_pmu.c b/lib/pfmlib_perf_event_pmu.c +index 86ff824..ca371d8 100644 +--- a/lib/pfmlib_perf_event_pmu.c ++++ b/lib/pfmlib_perf_event_pmu.c +@@ -344,6 +344,7 @@ gen_tracepoint_table(void) + + err = 0; + while((d1 = readdir(dir1)) && err >= 0) { ++ int retlen; + + if (!strcmp(d1->d_name, ".")) + continue; +@@ -351,7 +352,10 @@ gen_tracepoint_table(void) + if (!strcmp(d1->d_name, "..")) + continue; + +- snprintf(d2path, MAXPATHLEN, "%s/%s", debugfs_mnt, d1->d_name); ++ retlen = snprintf(d2path, MAXPATHLEN, "%s/%s", debugfs_mnt, d1->d_name); ++ /* if string truncated do not try to open the corrupted path */ ++ if (retlen < 0 || retlen >= MAXPATHLEN) ++ continue; + + /* fails if d2path is not a directory */ + dir2 = opendir(d2path); +@@ -398,10 +402,16 @@ gen_tracepoint_table(void) + continue; + + #ifdef HAS_OPENAT +- snprintf(idpath, MAXPATHLEN, "%s/id", d2->d_name); ++ retlen = snprintf(idpath, MAXPATHLEN, "%s/id", d2->d_name); ++ /* if string truncated do not try to open the corrupted path */ ++ if (retlen < 0 || retlen >= MAXPATHLEN) ++ continue; + fd = openat(dir2_fd, idpath, O_RDONLY); + #else +- snprintf(idpath, MAXPATHLEN, "%s/%s/id", d2path, d2->d_name); ++ retlen = snprintf(idpath, MAXPATHLEN, "%s/%s/id", d2path, d2->d_name); ++ /* if string truncated do not try to open the corrupted path */ ++ if (retlen < 0 || retlen >= MAXPATHLEN) ++ continue; + fd = open(idpath, O_RDONLY); + #endif + if (fd == -1) +diff --git a/perf_examples/syst_count.c b/perf_examples/syst_count.c +index e0fa42e..7841d01 100644 +--- a/perf_examples/syst_count.c ++++ b/perf_examples/syst_count.c +@@ -112,12 +112,14 @@ open_cgroup(char *name) + { + char path[MAX_PATH+1]; + char mnt[MAX_PATH+1]; +- int cfd; ++ int cfd, retlen; + + if (cgroupfs_find_mountpoint(mnt, MAX_PATH+1)) + errx(1, "cannot find cgroup fs mount point"); + +- snprintf(path, MAX_PATH, "%s/%s", mnt, name); ++ retlen = snprintf(path, MAX_PATH, "%s/%s", mnt, name); ++ if (retlen < 0 || retlen >= MAX_PATH) ++ warn("path truncated %s/%s\n", mnt, name); + + cfd = open(path, O_RDONLY); + if (cfd == -1) +diff --git a/perf_examples/syst_smpl.c b/perf_examples/syst_smpl.c +index 6b70e0e..a8b00df 100755 +--- a/perf_examples/syst_smpl.c ++++ b/perf_examples/syst_smpl.c +@@ -278,12 +278,14 @@ open_cgroup(char *name) + { + char path[MAX_PATH+1]; + char mnt[MAX_PATH+1]; +- int cfd; ++ int cfd, retlen; + + if (cgroupfs_find_mountpoint(mnt, MAX_PATH+1)) + errx(1, "cannot find cgroup fs mount point"); + +- snprintf(path, MAX_PATH, "%s/%s", mnt, name); ++ retlen = snprintf(path, MAX_PATH, "%s/%s", mnt, name); ++ if (retlen < 0 || retlen >= MAX_PATH) ++ warn("path truncated %s/%s\n", mnt, name); + + cfd = open(path, O_RDONLY); + if (cfd == -1) diff --git a/libpfm.spec b/libpfm.spec index eb0ed58..0424a04 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.9.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Library to encode performance events for use by perf tool @@ -18,6 +18,7 @@ Group: System Environment/Libraries License: MIT URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz +Patch1: libpfm-truncation.patch %if %{with python} BuildRequires: python2-devel @@ -66,6 +67,7 @@ Python bindings for libpfm4 and perf_event_open system call. %prep %setup -q +%patch1 -p1 -b .trun %build %if %{with python} @@ -114,6 +116,9 @@ make \ %endif %changelog +* Tue Jan 30 2018 William Cohen - 4.9.0-4 +- Address truncation issues. + * Tue Jan 30 2018 William Cohen - 4.9.0-3 - Use the RPM build flags. (RHBZ #1540262) From 4225d4f522ae203169f2e12d7ec0d73c9c413d81 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 7 Feb 2018 23:02:18 +0000 Subject: [PATCH 41/94] - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 0424a04..0fadf16 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.9.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Library to encode performance events for use by perf tool @@ -116,6 +116,9 @@ make \ %endif %changelog +* Wed Feb 07 2018 Fedora Release Engineering - 4.9.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + * Tue Jan 30 2018 William Cohen - 4.9.0-4 - Address truncation issues. From 75e5fed5ded6dbbbf7c3020732d00c119f3d4961 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Mon, 26 Feb 2018 11:42:26 -0500 Subject: [PATCH 42/94] Pass in LDFLAGS rhbz1540262 --- libpfm.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index 0fadf16..f30ab21 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.9.0 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Library to encode performance events for use by perf tool @@ -76,7 +76,7 @@ Python bindings for libpfm4 and perf_event_open system call. %global python_config CONFIG_PFMLIB_NOPYTHON=y %endif make %{python_config} %{?_smp_mflags} \ - OPTIM="%{optflags}" + OPTIM="%{optflags}" LDFLAGS="%{build_ldflags}" %install @@ -116,6 +116,9 @@ make \ %endif %changelog +* Mon Feb 26 2018 Fedora Release Engineering - 4.9.0-6 +- Pass in LDFLAGS for build. + * Wed Feb 07 2018 Fedora Release Engineering - 4.9.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild From 360481a7b305ddba46c9fa6c026f8d3f6815596b Mon Sep 17 00:00:00 2001 From: William Cohen Date: Sun, 10 Jun 2018 23:03:58 -0400 Subject: [PATCH 43/94] - Rebase on libpfm-4.10.0. - Use Python 3. --- .gitignore | 1 + libpfm-cavium-tx2.patch | 13 ++++++ libpfm-python3-setup.patch | 10 +++++ libpfm-truncation.patch | 85 -------------------------------------- libpfm.spec | 31 ++++++++------ sources | 2 +- 6 files changed, 44 insertions(+), 98 deletions(-) create mode 100644 libpfm-cavium-tx2.patch create mode 100644 libpfm-python3-setup.patch delete mode 100644 libpfm-truncation.patch diff --git a/.gitignore b/.gitignore index abfa124..f98c1f0 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ /libpfm-4.7.0.tar.gz /libpfm-4.8.0.tar.gz /libpfm-4.9.0.tar.gz +/libpfm-4.10.0.tar.gz diff --git a/libpfm-cavium-tx2.patch b/libpfm-cavium-tx2.patch new file mode 100644 index 0000000..77c58b3 --- /dev/null +++ b/libpfm-cavium-tx2.patch @@ -0,0 +1,13 @@ +diff --git a/lib/Makefile b/lib/Makefile +index 129db90..f1241ad 100644 +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -360,7 +360,7 @@ INC_ARM=pfmlib_arm_priv.h \ + events/arm_cortex_a15_events.h \ + events/arm_cortex_a57_events.h \ + events/arm_cortex_a53_events.h \ +- events/arm_thunderx2_events.h ++ events/arm_cavium_tx2_events.h + + INC_ARM64=events/arm_cortex_a57_events.h \ + events/arm_cortex_a53_events.h diff --git a/libpfm-python3-setup.patch b/libpfm-python3-setup.patch new file mode 100644 index 0000000..f43187a --- /dev/null +++ b/libpfm-python3-setup.patch @@ -0,0 +1,10 @@ +diff --git a/python/setup.py b/python/setup.py +index eda8fa5..dff0f27 100755 +--- a/python/setup.py ++++ b/python/setup.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + + from distutils.core import setup, Extension + from distutils.command.install_data import install_data diff --git a/libpfm-truncation.patch b/libpfm-truncation.patch deleted file mode 100644 index 99170f3..0000000 --- a/libpfm-truncation.patch +++ /dev/null @@ -1,85 +0,0 @@ -diff --git a/lib/pfmlib_perf_event_pmu.c b/lib/pfmlib_perf_event_pmu.c -index 86ff824..ca371d8 100644 ---- a/lib/pfmlib_perf_event_pmu.c -+++ b/lib/pfmlib_perf_event_pmu.c -@@ -344,6 +344,7 @@ gen_tracepoint_table(void) - - err = 0; - while((d1 = readdir(dir1)) && err >= 0) { -+ int retlen; - - if (!strcmp(d1->d_name, ".")) - continue; -@@ -351,7 +352,10 @@ gen_tracepoint_table(void) - if (!strcmp(d1->d_name, "..")) - continue; - -- snprintf(d2path, MAXPATHLEN, "%s/%s", debugfs_mnt, d1->d_name); -+ retlen = snprintf(d2path, MAXPATHLEN, "%s/%s", debugfs_mnt, d1->d_name); -+ /* if string truncated do not try to open the corrupted path */ -+ if (retlen < 0 || retlen >= MAXPATHLEN) -+ continue; - - /* fails if d2path is not a directory */ - dir2 = opendir(d2path); -@@ -398,10 +402,16 @@ gen_tracepoint_table(void) - continue; - - #ifdef HAS_OPENAT -- snprintf(idpath, MAXPATHLEN, "%s/id", d2->d_name); -+ retlen = snprintf(idpath, MAXPATHLEN, "%s/id", d2->d_name); -+ /* if string truncated do not try to open the corrupted path */ -+ if (retlen < 0 || retlen >= MAXPATHLEN) -+ continue; - fd = openat(dir2_fd, idpath, O_RDONLY); - #else -- snprintf(idpath, MAXPATHLEN, "%s/%s/id", d2path, d2->d_name); -+ retlen = snprintf(idpath, MAXPATHLEN, "%s/%s/id", d2path, d2->d_name); -+ /* if string truncated do not try to open the corrupted path */ -+ if (retlen < 0 || retlen >= MAXPATHLEN) -+ continue; - fd = open(idpath, O_RDONLY); - #endif - if (fd == -1) -diff --git a/perf_examples/syst_count.c b/perf_examples/syst_count.c -index e0fa42e..7841d01 100644 ---- a/perf_examples/syst_count.c -+++ b/perf_examples/syst_count.c -@@ -112,12 +112,14 @@ open_cgroup(char *name) - { - char path[MAX_PATH+1]; - char mnt[MAX_PATH+1]; -- int cfd; -+ int cfd, retlen; - - if (cgroupfs_find_mountpoint(mnt, MAX_PATH+1)) - errx(1, "cannot find cgroup fs mount point"); - -- snprintf(path, MAX_PATH, "%s/%s", mnt, name); -+ retlen = snprintf(path, MAX_PATH, "%s/%s", mnt, name); -+ if (retlen < 0 || retlen >= MAX_PATH) -+ warn("path truncated %s/%s\n", mnt, name); - - cfd = open(path, O_RDONLY); - if (cfd == -1) -diff --git a/perf_examples/syst_smpl.c b/perf_examples/syst_smpl.c -index 6b70e0e..a8b00df 100755 ---- a/perf_examples/syst_smpl.c -+++ b/perf_examples/syst_smpl.c -@@ -278,12 +278,14 @@ open_cgroup(char *name) - { - char path[MAX_PATH+1]; - char mnt[MAX_PATH+1]; -- int cfd; -+ int cfd, retlen; - - if (cgroupfs_find_mountpoint(mnt, MAX_PATH+1)) - errx(1, "cannot find cgroup fs mount point"); - -- snprintf(path, MAX_PATH, "%s/%s", mnt, name); -+ retlen = snprintf(path, MAX_PATH, "%s/%s", mnt, name); -+ if (retlen < 0 || retlen >= MAX_PATH) -+ warn("path truncated %s/%s\n", mnt, name); - - cfd = open(path, O_RDONLY); - if (cfd == -1) diff --git a/libpfm.spec b/libpfm.spec index f30ab21..24fad5d 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -1,7 +1,7 @@ %bcond_without python %if %{with python} -%define python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)") -%define python_prefix %(python -c "import sys; print sys.prefix") +%define python_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") +%define python_prefix %(python3 -c "import sys; print (sys.prefix)") %{?filter_setup: %filter_provides_in %{python_sitearch}/perfmon/.*\.so$ %filter_setup @@ -9,8 +9,8 @@ %endif Name: libpfm -Version: 4.9.0 -Release: 6%{?dist} +Version: 4.10.0 +Release: 1%{?dist} Summary: Library to encode performance events for use by perf tool @@ -18,11 +18,13 @@ Group: System Environment/Libraries License: MIT URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz -Patch1: libpfm-truncation.patch +Patch1: libpfm-cavium-tx2.patch +Patch2: libpfm-python3-setup.patch %if %{with python} -BuildRequires: python2-devel -BuildRequires: python2-setuptools +BuildRequires: python3 +BuildRequires: python3-devel +BuildRequires: python3-setuptools BuildRequires: swig %endif @@ -51,8 +53,8 @@ Static version of the libpfm library for performance monitoring applications for the perf_events interface. %if %{with python} -%package -n python2-libpfm -%{?python_provide:%python_provide python2-libpfm} +%package -n python3-libpfm +%{?python_provide:%python_provide python3-libpfm} # Remove before F30 Provides: %{name}-python = %{version}-%{release} Provides: %{name}-python%{?_isa} = %{version}-%{release} @@ -61,13 +63,14 @@ Summary: Python bindings for libpfm and perf_event_open system call Group: Development/Languages Requires: %{name}%{?_isa} = %{version}-%{release} -%description -n python2-libpfm +%description -n python3-libpfm Python bindings for libpfm4 and perf_event_open system call. %endif %prep %setup -q -%patch1 -p1 -b .trun +%patch1 -p1 -b .cavium +%patch2 -p1 -b .python3 %build %if %{with python} @@ -111,11 +114,15 @@ make \ %{_libdir}/lib*.a %if %{with python} -%files -n python2-libpfm +%files -n python3-libpfm %{python_sitearch}/* %endif %changelog +* Fri Jun 8 2018 William Cohen - 4.10.0-1 +- Rebase on libpfm-4.10.0. +- Use Python 3. + * Mon Feb 26 2018 Fedora Release Engineering - 4.9.0-6 - Pass in LDFLAGS for build. diff --git a/sources b/sources index 41e74a5..d847ef1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libpfm-4.9.0.tar.gz) = 9e62556a5e8029b94383bd54176c5171fec7f919b6826d5d348837540922874c922eb0e01d7835c388ae28809c798f4b3da8ba751777767ce4a0e47ddab2b645 +SHA512 (libpfm-4.10.0.tar.gz) = c2e1a7d389efebc27a32dd3a5a6f3e8e8d624347616e06daf7bf06c0d5b8ca39cee5821ad5cf23330d47ed987697fcc05aa54660b8f6899f62aad9cd05e908f9 From d7cc62017d5251bfd1ca7b8830e417611f192971 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Tue, 12 Jun 2018 11:58:41 -0400 Subject: [PATCH 44/94] Use upstream libpfm cavium patch. --- libpfm-cavium-tx2.patch | 37 ++++++++++++++++++++++++++++++++++--- libpfm.spec | 5 ++++- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/libpfm-cavium-tx2.patch b/libpfm-cavium-tx2.patch index 77c58b3..bea57af 100644 --- a/libpfm-cavium-tx2.patch +++ b/libpfm-cavium-tx2.patch @@ -1,8 +1,22 @@ +commit c3ca7e011e7ad23df326d9817453674d1290fb1a +Author: Stephane Eranian +Date: Tue Jun 12 08:26:53 2018 -0700 + + Fix Cavium Thunder X2 build issues + + Release v4.10.0 had a few bugs related to Cavium Thunder X2 build. + + - lib/Makefile dependency was pointing to the wrong Cavium Thunder X2 event file name + - lib/Makefile was missing Cavium event file dependency for ARM64 + - lib/pfmlib_commmon.c was missing support for Cavium Thunder X2 in 32-bit mode + + Signed-off-by: Stephane Eranian + diff --git a/lib/Makefile b/lib/Makefile -index 129db90..f1241ad 100644 +index 129db90..2eb3ebb 100644 --- a/lib/Makefile +++ b/lib/Makefile -@@ -360,7 +360,7 @@ INC_ARM=pfmlib_arm_priv.h \ +@@ -360,10 +360,11 @@ INC_ARM=pfmlib_arm_priv.h \ events/arm_cortex_a15_events.h \ events/arm_cortex_a57_events.h \ events/arm_cortex_a53_events.h \ @@ -10,4 +24,21 @@ index 129db90..f1241ad 100644 + events/arm_cavium_tx2_events.h INC_ARM64=events/arm_cortex_a57_events.h \ - events/arm_cortex_a53_events.h +- events/arm_cortex_a53_events.h ++ events/arm_cortex_a53_events.h \ ++ events/arm_cavium_tx2_events.h + + INCDEP=$(INC_COMMON) $(INCARCH) + +diff --git a/lib/pfmlib_common.c b/lib/pfmlib_common.c +index f5bce8b..ca93d72 100644 +--- a/lib/pfmlib_common.c ++++ b/lib/pfmlib_common.c +@@ -482,6 +482,7 @@ static pfmlib_pmu_t *pfmlib_pmus[]= + &arm_cortex_a57_support, + &arm_cortex_a53_support, + &arm_xgene_support, ++ &arm_thunderx2_support, + #endif + #ifdef CONFIG_PFMLIB_ARCH_ARM64 + &arm_cortex_a57_support, diff --git a/libpfm.spec b/libpfm.spec index 24fad5d..7f6a301 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.10.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library to encode performance events for use by perf tool @@ -119,6 +119,9 @@ make \ %endif %changelog +* Tue Jun 12 2018 William Cohen - 4.10.0-2 +- Use upstream libpfm cavium patch. + * Fri Jun 8 2018 William Cohen - 4.10.0-1 - Rebase on libpfm-4.10.0. - Use Python 3. From e8ae3bf138b227402584b27ba0fbc4355c052b47 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Fri, 15 Jun 2018 09:40:41 -0400 Subject: [PATCH 45/94] Rebase 4.10.1. --- .gitignore | 1 + libpfm-cavium-tx2.patch | 44 ----------------------------------------- libpfm.spec | 9 +++++---- sources | 2 +- 4 files changed, 7 insertions(+), 49 deletions(-) delete mode 100644 libpfm-cavium-tx2.patch diff --git a/.gitignore b/.gitignore index f98c1f0..74baaf8 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ /libpfm-4.8.0.tar.gz /libpfm-4.9.0.tar.gz /libpfm-4.10.0.tar.gz +/libpfm-4.10.1.tar.gz diff --git a/libpfm-cavium-tx2.patch b/libpfm-cavium-tx2.patch deleted file mode 100644 index bea57af..0000000 --- a/libpfm-cavium-tx2.patch +++ /dev/null @@ -1,44 +0,0 @@ -commit c3ca7e011e7ad23df326d9817453674d1290fb1a -Author: Stephane Eranian -Date: Tue Jun 12 08:26:53 2018 -0700 - - Fix Cavium Thunder X2 build issues - - Release v4.10.0 had a few bugs related to Cavium Thunder X2 build. - - - lib/Makefile dependency was pointing to the wrong Cavium Thunder X2 event file name - - lib/Makefile was missing Cavium event file dependency for ARM64 - - lib/pfmlib_commmon.c was missing support for Cavium Thunder X2 in 32-bit mode - - Signed-off-by: Stephane Eranian - -diff --git a/lib/Makefile b/lib/Makefile -index 129db90..2eb3ebb 100644 ---- a/lib/Makefile -+++ b/lib/Makefile -@@ -360,10 +360,11 @@ INC_ARM=pfmlib_arm_priv.h \ - events/arm_cortex_a15_events.h \ - events/arm_cortex_a57_events.h \ - events/arm_cortex_a53_events.h \ -- events/arm_thunderx2_events.h -+ events/arm_cavium_tx2_events.h - - INC_ARM64=events/arm_cortex_a57_events.h \ -- events/arm_cortex_a53_events.h -+ events/arm_cortex_a53_events.h \ -+ events/arm_cavium_tx2_events.h - - INCDEP=$(INC_COMMON) $(INCARCH) - -diff --git a/lib/pfmlib_common.c b/lib/pfmlib_common.c -index f5bce8b..ca93d72 100644 ---- a/lib/pfmlib_common.c -+++ b/lib/pfmlib_common.c -@@ -482,6 +482,7 @@ static pfmlib_pmu_t *pfmlib_pmus[]= - &arm_cortex_a57_support, - &arm_cortex_a53_support, - &arm_xgene_support, -+ &arm_thunderx2_support, - #endif - #ifdef CONFIG_PFMLIB_ARCH_ARM64 - &arm_cortex_a57_support, diff --git a/libpfm.spec b/libpfm.spec index 7f6a301..1337b04 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,8 +9,8 @@ %endif Name: libpfm -Version: 4.10.0 -Release: 2%{?dist} +Version: 4.10.1 +Release: 1%{?dist} Summary: Library to encode performance events for use by perf tool @@ -18,7 +18,6 @@ Group: System Environment/Libraries License: MIT URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz -Patch1: libpfm-cavium-tx2.patch Patch2: libpfm-python3-setup.patch %if %{with python} @@ -69,7 +68,6 @@ Python bindings for libpfm4 and perf_event_open system call. %prep %setup -q -%patch1 -p1 -b .cavium %patch2 -p1 -b .python3 %build @@ -119,6 +117,9 @@ make \ %endif %changelog +* Fri Jun 15 2018 William Cohen - 4.10.1-1 +- Rebase on libpfm-4.10.1. + * Tue Jun 12 2018 William Cohen - 4.10.0-2 - Use upstream libpfm cavium patch. diff --git a/sources b/sources index d847ef1..2f0b0d2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libpfm-4.10.0.tar.gz) = c2e1a7d389efebc27a32dd3a5a6f3e8e8d624347616e06daf7bf06c0d5b8ca39cee5821ad5cf23330d47ed987697fcc05aa54660b8f6899f62aad9cd05e908f9 +SHA512 (libpfm-4.10.1.tar.gz) = 33d99824216b4d83784e0db9f1aae3b39f84c2ba42dee64dde0b3c43cc5ee3a18c206d9044e75bf10867768add7cb9967c6318f7aa196f178f334271fa05e1aa From d69ef2206baab648838c0cfef4cf920beaa93eab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 19 Jun 2018 10:46:14 +0200 Subject: [PATCH 46/94] Rebuilt for Python 3.7 --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 1337b04..8d6ffdf 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.10.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library to encode performance events for use by perf tool @@ -117,6 +117,9 @@ make \ %endif %changelog +* Tue Jun 19 2018 Miro Hrončok - 4.10.1-2 +- Rebuilt for Python 3.7 + * Fri Jun 15 2018 William Cohen - 4.10.1-1 - Rebase on libpfm-4.10.1. From 7f4ef1dde1e63373af66e4b2ed29658e9848dda5 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 13 Jul 2018 08:39:19 +0000 Subject: [PATCH 47/94] - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 8d6ffdf..8df0334 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.10.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Library to encode performance events for use by perf tool @@ -117,6 +117,9 @@ make \ %endif %changelog +* Fri Jul 13 2018 Fedora Release Engineering - 4.10.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + * Tue Jun 19 2018 Miro Hrončok - 4.10.1-2 - Rebuilt for Python 3.7 From af5418c81ea36547c3cdd46d819869263ad5fe6a Mon Sep 17 00:00:00 2001 From: William Cohen Date: Sun, 15 Jul 2018 20:05:06 -0400 Subject: [PATCH 48/94] Add gcc Buildrequires. --- libpfm.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 8df0334..71a3c76 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.10.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Library to encode performance events for use by perf tool @@ -20,6 +20,7 @@ URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz Patch2: libpfm-python3-setup.patch +BuildRequires: gcc %if %{with python} BuildRequires: python3 BuildRequires: python3-devel @@ -117,6 +118,9 @@ make \ %endif %changelog +* Sun Jul 15 2018 William Cohen - 4.10.1-4 +- Add gcc Buildrequires. + * Fri Jul 13 2018 Fedora Release Engineering - 4.10.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild From 686670e6179832d2d5f6e94c45f7bf31e7e57a67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 17 Jul 2018 17:10:59 +0200 Subject: [PATCH 49/94] Update Python macros to new packaging standards --- libpfm.spec | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index 71a3c76..f612f58 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -3,14 +3,14 @@ %define python_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %define python_prefix %(python3 -c "import sys; print (sys.prefix)") %{?filter_setup: -%filter_provides_in %{python_sitearch}/perfmon/.*\.so$ +%filter_provides_in %{python2_sitearch}/perfmon/.*\.so$ %filter_setup } %endif Name: libpfm Version: 4.10.1 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Library to encode performance events for use by perf tool @@ -114,10 +114,14 @@ make \ %if %{with python} %files -n python3-libpfm -%{python_sitearch}/* +%{python2_sitearch}/* %endif %changelog +* Tue Jul 17 2018 Miro Hrončok - 4.10.1-5 +- Update Python macros to new packaging standards + (See https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package) + * Sun Jul 15 2018 William Cohen - 4.10.1-4 - Add gcc Buildrequires. From 393b4b06e6836124ac862974ec5a17a56653854b Mon Sep 17 00:00:00 2001 From: William Cohen Date: Tue, 24 Jul 2018 11:41:08 -0400 Subject: [PATCH 50/94] Should be using python3 macros. --- libpfm.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index f612f58..746fc6a 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -3,7 +3,7 @@ %define python_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %define python_prefix %(python3 -c "import sys; print (sys.prefix)") %{?filter_setup: -%filter_provides_in %{python2_sitearch}/perfmon/.*\.so$ +%filter_provides_in %{python3_sitearch}/perfmon/.*\.so$ %filter_setup } %endif @@ -114,7 +114,7 @@ make \ %if %{with python} %files -n python3-libpfm -%{python2_sitearch}/* +%{python3_sitearch}/* %endif %changelog From f1bd5ac9655d3938696d400d790586176a52f39c Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 22 Jan 2019 18:40:01 +0100 Subject: [PATCH 51/94] Remove obsolete ldconfig scriptlets References: https://fedoraproject.org/wiki/Changes/RemoveObsoleteScriptlets Signed-off-by: Igor Gnatenko --- libpfm.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index 746fc6a..e71a692 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -97,8 +97,7 @@ make \ LDCONFIG=/bin/true \ install -%post -p /sbin/ldconfig -%postun -p /sbin/ldconfig +%ldconfig_scriptlets %files %doc README From 5577a0591b9ae8ebaea57bfc044844b957bb8ad0 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 28 Jan 2019 20:17:52 +0100 Subject: [PATCH 52/94] Remove obsolete Group tag References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag --- libpfm.spec | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index e71a692..b148203 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -14,7 +14,6 @@ Release: 5%{?dist} Summary: Library to encode performance events for use by perf tool -Group: System Environment/Libraries License: MIT URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz @@ -36,7 +35,6 @@ for the perf_events interface available in upstream Linux kernels since v2.6.31. %package devel Summary: Development library to encode performance events for perf_events based tools -Group: Development/Libraries Requires: %{name}%{?_isa} = %{version}-%{release} %description devel @@ -45,7 +43,6 @@ applications for the perf_events interface. %package static Summary: Static library to encode performance events for perf_events based tools -Group: Development/Libraries Requires: %{name}%{?_isa} = %{version}-%{release} %description static @@ -60,7 +57,6 @@ Provides: %{name}-python = %{version}-%{release} Provides: %{name}-python%{?_isa} = %{version}-%{release} Obsoletes: %{name}-python < %{version}-%{release} Summary: Python bindings for libpfm and perf_event_open system call -Group: Development/Languages Requires: %{name}%{?_isa} = %{version}-%{release} %description -n python3-libpfm From 6e29b869b351165976912f00da71e05a6cacc093 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 1 Feb 2019 07:57:27 +0000 Subject: [PATCH 53/94] - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index b148203..15b759f 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.10.1 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Library to encode performance events for use by perf tool @@ -113,6 +113,9 @@ make \ %endif %changelog +* Fri Feb 01 2019 Fedora Release Engineering - 4.10.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Tue Jul 17 2018 Miro Hrončok - 4.10.1-5 - Update Python macros to new packaging standards (See https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package) From 1eb63415a4973518612a277f0c2d0a3257153b1d Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 25 Jul 2019 14:07:29 +0000 Subject: [PATCH 54/94] - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 15b759f..42cb76c 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.10.1 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Library to encode performance events for use by perf tool @@ -113,6 +113,9 @@ make \ %endif %changelog +* Thu Jul 25 2019 Fedora Release Engineering - 4.10.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + * Fri Feb 01 2019 Fedora Release Engineering - 4.10.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild From d4b053985647e430e1e645d50edf1824935fa9f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 19 Aug 2019 10:18:18 +0200 Subject: [PATCH 55/94] Rebuilt for Python 3.8 --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 42cb76c..e980828 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.10.1 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Library to encode performance events for use by perf tool @@ -113,6 +113,9 @@ make \ %endif %changelog +* Mon Aug 19 2019 Miro Hrončok - 4.10.1-8 +- Rebuilt for Python 3.8 + * Thu Jul 25 2019 Fedora Release Engineering - 4.10.1-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild From c5e835f5e85af74d80350e19da366124353538e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 3 Oct 2019 13:55:53 +0200 Subject: [PATCH 56/94] Rebuilt for Python 3.8.0rc1 (#1748018) --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index e980828..894ccf9 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.10.1 -Release: 8%{?dist} +Release: 9%{?dist} Summary: Library to encode performance events for use by perf tool @@ -113,6 +113,9 @@ make \ %endif %changelog +* Thu Oct 03 2019 Miro Hrončok - 4.10.1-9 +- Rebuilt for Python 3.8.0rc1 (#1748018) + * Mon Aug 19 2019 Miro Hrončok - 4.10.1-8 - Rebuilt for Python 3.8 From a7cd34e5cbe5b9b51576b57858027d6b4b73fa5e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 29 Jan 2020 10:03:11 +0000 Subject: [PATCH 57/94] - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 894ccf9..c536376 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.10.1 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Library to encode performance events for use by perf tool @@ -113,6 +113,9 @@ make \ %endif %changelog +* Wed Jan 29 2020 Fedora Release Engineering - 4.10.1-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + * Thu Oct 03 2019 Miro Hrončok - 4.10.1-9 - Rebuilt for Python 3.8.0rc1 (#1748018) From f4ffc7d5601b497f43c0d64584ee1c35026d66e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 26 May 2020 02:51:00 +0200 Subject: [PATCH 58/94] Rebuilt for Python 3.9 --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index c536376..f456e65 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.10.1 -Release: 10%{?dist} +Release: 11%{?dist} Summary: Library to encode performance events for use by perf tool @@ -113,6 +113,9 @@ make \ %endif %changelog +* Tue May 26 2020 Miro Hrončok - 4.10.1-11 +- Rebuilt for Python 3.9 + * Wed Jan 29 2020 Fedora Release Engineering - 4.10.1-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild From 13951d41422a60bb79b438abf5ac16e8b2abeaa1 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Mon, 13 Jul 2020 21:21:46 +0000 Subject: [PATCH 59/94] Use make macros https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro --- libpfm.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index f456e65..358a31e 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.10.1 -Release: 11%{?dist} +Release: 12%{?dist} Summary: Library to encode performance events for use by perf tool @@ -73,7 +73,7 @@ Python bindings for libpfm4 and perf_event_open system call. %else %global python_config CONFIG_PFMLIB_NOPYTHON=y %endif -make %{python_config} %{?_smp_mflags} \ +%make_build %{python_config} \ OPTIM="%{optflags}" LDFLAGS="%{build_ldflags}" @@ -113,6 +113,10 @@ make \ %endif %changelog +* Mon Jul 13 2020 Tom Stellard - 4.10.1-12 +- Use make macros +- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro + * Tue May 26 2020 Miro Hrončok - 4.10.1-11 - Rebuilt for Python 3.9 From a05595b455f32b92d1a4d4a19deb7eb2f519a54f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 28 Jul 2020 05:20:17 +0000 Subject: [PATCH 60/94] - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 358a31e..c6fd1e1 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -10,7 +10,7 @@ Name: libpfm Version: 4.10.1 -Release: 12%{?dist} +Release: 13%{?dist} Summary: Library to encode performance events for use by perf tool @@ -113,6 +113,9 @@ make \ %endif %changelog +* Tue Jul 28 2020 Fedora Release Engineering - 4.10.1-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Mon Jul 13 2020 Tom Stellard - 4.10.1-12 - Use make macros - https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro From be509d634ca6fb4275472b73c06ca7b618203f56 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Tue, 8 Sep 2020 11:09:03 -0400 Subject: [PATCH 61/94] Rebase to libpfm-4.11.0. --- .gitignore | 1 + libpfm.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 74baaf8..df137f8 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ /libpfm-4.9.0.tar.gz /libpfm-4.10.0.tar.gz /libpfm-4.10.1.tar.gz +/libpfm-4.11.0.tar.gz diff --git a/libpfm.spec b/libpfm.spec index c6fd1e1..ab04d61 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,8 +9,8 @@ %endif Name: libpfm -Version: 4.10.1 -Release: 13%{?dist} +Version: 4.11.0 +Release: 1%{?dist} Summary: Library to encode performance events for use by perf tool @@ -113,6 +113,9 @@ make \ %endif %changelog +* Tue Sep 08 2020 William Cohen - 4.11.0-1 +- Rebase on libpfm-4.11.0. + * Tue Jul 28 2020 Fedora Release Engineering - 4.10.1-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild diff --git a/sources b/sources index 2f0b0d2..3d5afdf 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libpfm-4.10.1.tar.gz) = 33d99824216b4d83784e0db9f1aae3b39f84c2ba42dee64dde0b3c43cc5ee3a18c206d9044e75bf10867768add7cb9967c6318f7aa196f178f334271fa05e1aa +SHA512 (libpfm-4.11.0.tar.gz) = 633035b8a7b35973437572095cdc80d422b2a1a61e74e14f106db95fa8e44e4518e591699cc457f828b8f2fb63f60eef6d0c7535c6b4c9a6c3a70d4550b3c3c7 From 035bc07c0b6de22393e26b7b976e50fc447303a6 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Wed, 6 Jan 2021 19:45:02 +0000 Subject: [PATCH 62/94] Add BuildRequires: make https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot --- libpfm.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/libpfm.spec b/libpfm.spec index ab04d61..04350d9 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -19,6 +19,7 @@ URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz Patch2: libpfm-python3-setup.patch +BuildRequires: make BuildRequires: gcc %if %{with python} BuildRequires: python3 From fab1ad1b122671c5862842378860061bfa114e0d Mon Sep 17 00:00:00 2001 From: William Cohen Date: Fri, 22 Jan 2021 13:30:29 -0500 Subject: [PATCH 63/94] Related #1918922 --- libpfm.spec | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 04350d9..d25908b 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -1,3 +1,5 @@ +# Default to no static libraries +%{!?with_static: %global with_static 0} %bcond_without python %if %{with python} %define python_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") @@ -10,7 +12,7 @@ Name: libpfm Version: 4.11.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library to encode performance events for use by perf tool @@ -42,6 +44,7 @@ Requires: %{name}%{?_isa} = %{version}-%{release} Development library and header files to create performance monitoring applications for the perf_events interface. +%if %{with_static} %package static Summary: Static library to encode performance events for perf_events based tools Requires: %{name}%{?_isa} = %{version}-%{release} @@ -49,6 +52,7 @@ Requires: %{name}%{?_isa} = %{version}-%{release} %description static Static version of the libpfm library for performance monitoring applications for the perf_events interface. +%endif %if %{with python} %package -n python3-libpfm @@ -94,6 +98,10 @@ make \ LDCONFIG=/bin/true \ install +%if !%{with_static} +rm $RPM_BUILD_ROOT%{_libdir}/lib*.a +%endif + %ldconfig_scriptlets %files @@ -105,8 +113,10 @@ make \ %{_mandir}/man3/* %{_libdir}/lib*.so +%if %{with_static} %files static %{_libdir}/lib*.a +%endif %if %{with python} %files -n python3-libpfm @@ -114,6 +124,9 @@ make \ %endif %changelog +* Fri Jan 22 2021 William Cohen - 4.11.0-2 +- By default disable generation of static libraries + * Tue Sep 08 2020 William Cohen - 4.11.0-1 - Rebase on libpfm-4.11.0. From 06bbef121d7df66d2b702d5cd2c4ddbb23736efd Mon Sep 17 00:00:00 2001 From: William Cohen Date: Sat, 23 Jan 2021 14:52:27 -0500 Subject: [PATCH 64/94] Re-enable libpfm-static for time being. --- libpfm.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index d25908b..cdccd52 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -1,5 +1,5 @@ # Default to no static libraries -%{!?with_static: %global with_static 0} +%{!?with_static: %global with_static 1} %bcond_without python %if %{with python} %define python_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") @@ -12,7 +12,7 @@ Name: libpfm Version: 4.11.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Library to encode performance events for use by perf tool @@ -124,6 +124,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Sat Jan 23 2021 William Cohen - 4.11.0-3 +- Reenable generation of static libraries for time being. + * Fri Jan 22 2021 William Cohen - 4.11.0-2 - By default disable generation of static libraries From 12dbc8b7aeac00fccadc9fe0142a4a26615c3088 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 26 Jan 2021 17:45:21 +0000 Subject: [PATCH 65/94] - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index cdccd52..f47edbf 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.11.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Library to encode performance events for use by perf tool @@ -124,6 +124,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Tue Jan 26 2021 Fedora Release Engineering - 4.11.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + * Sat Jan 23 2021 William Cohen - 4.11.0-3 - Reenable generation of static libraries for time being. From e5d977450b543353cbf6514ad6ba9a2442aa6917 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 4 Jun 2021 20:09:41 +0200 Subject: [PATCH 66/94] Rebuilt for Python 3.10 --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index f47edbf..3ced186 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.11.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Library to encode performance events for use by perf tool @@ -124,6 +124,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Fri Jun 04 2021 Python Maint - 4.11.0-5 +- Rebuilt for Python 3.10 + * Tue Jan 26 2021 Fedora Release Engineering - 4.11.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From 1e30143a01c044b2c7a7df6ddaeaeef40b2d1383 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 22 Jul 2021 12:06:05 +0000 Subject: [PATCH 67/94] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 3ced186..beac79b 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.11.0 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Library to encode performance events for use by perf tool @@ -124,6 +124,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Thu Jul 22 2021 Fedora Release Engineering - 4.11.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Fri Jun 04 2021 Python Maint - 4.11.0-5 - Rebuilt for Python 3.10 From dcd2f17914203c24c08d88f991066b1432f7e062 Mon Sep 17 00:00:00 2001 From: Michal Kolar Date: Mon, 20 Sep 2021 21:22:34 +0000 Subject: [PATCH 68/94] init FMF CI gating --- .fmf/version | 1 + gating.yaml | 19 +++++++ plans/ci.fmf | 6 +++ tests/libpfm-testsuite/Makefile | 63 ++++++++++++++++++++++++ tests/libpfm-testsuite/PURPOSE | 3 ++ tests/libpfm-testsuite/main.fmf | 16 ++++++ tests/libpfm-testsuite/runtest.sh | 82 +++++++++++++++++++++++++++++++ 7 files changed, 190 insertions(+) create mode 100644 .fmf/version create mode 100644 gating.yaml create mode 100644 plans/ci.fmf create mode 100644 tests/libpfm-testsuite/Makefile create mode 100644 tests/libpfm-testsuite/PURPOSE create mode 100644 tests/libpfm-testsuite/main.fmf create mode 100755 tests/libpfm-testsuite/runtest.sh diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..ce3cdc1 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,19 @@ +--- !Policy +product_versions: + - fedora-* +decision_context: bodhi_update_push_stable +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} +--- !Policy +product_versions: + - rhel-8 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional} +--- !Policy +product_versions: + - rhel-9 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional} diff --git a/plans/ci.fmf b/plans/ci.fmf new file mode 100644 index 0000000..1ad2c12 --- /dev/null +++ b/plans/ci.fmf @@ -0,0 +1,6 @@ +summary: CI Gating Plan +discover: + how: fmf + directory: tests +execute: + how: beakerlib diff --git a/tests/libpfm-testsuite/Makefile b/tests/libpfm-testsuite/Makefile new file mode 100644 index 0000000..ba93382 --- /dev/null +++ b/tests/libpfm-testsuite/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/libpfm/Sanity/libpfm-testsuite +# Description: libpfm-testsuite testing by upstream testsuite +# Author: Michal Kolar +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2021 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/libpfm/Sanity/libpfm-testsuite +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Michal Kolar " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: libpfm-testsuite testing by upstream testsuite" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 1h" >> $(METADATA) + @echo "RunFor: libpfm" >> $(METADATA) + @echo "Requires: libpfm rpm-build yum-utils make gcc" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5 -RHEL6 -RHEL7" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/libpfm-testsuite/PURPOSE b/tests/libpfm-testsuite/PURPOSE new file mode 100644 index 0000000..9c4a286 --- /dev/null +++ b/tests/libpfm-testsuite/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /tools/libpfm/Sanity/libpfm-testsuite +Description: libpfm-testsuite testing by upstream testsuite +Author: Michal Kolar diff --git a/tests/libpfm-testsuite/main.fmf b/tests/libpfm-testsuite/main.fmf new file mode 100644 index 0000000..8b5c8cf --- /dev/null +++ b/tests/libpfm-testsuite/main.fmf @@ -0,0 +1,16 @@ +summary: libpfm-testsuite testing by upstream testsuite +description: '' +contact: Michal Kolar +component: +- libpfm +test: ./runtest.sh +framework: beakerlib +recommend: +- libpfm +- rpm-build +- yum-utils +- make +- gcc +duration: 1h +extra-summary: /tools/libpfm/Sanity/libpfm-testsuite +extra-task: /tools/libpfm/Sanity/libpfm-testsuite diff --git a/tests/libpfm-testsuite/runtest.sh b/tests/libpfm-testsuite/runtest.sh new file mode 100755 index 0000000..7c8e03d --- /dev/null +++ b/tests/libpfm-testsuite/runtest.sh @@ -0,0 +1,82 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/libpfm/Sanity/libpfm-testsuite +# Description: libpfm-testsuite testing by upstream testsuite +# Author: Michal Kolar +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2021 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +BUILD_USER=${BUILD_USER:-lbpfmbld} +TESTS_COUNT_MIN=${TESTS_COUNT_MIN:-1} +PACKAGE="libpfm" +REQUIRES="$PACKAGE rpm-build make gcc" +if rlIsFedora; then + REQUIRES="$REQUIRES dnf-utils" +else + REQUIRES="$REQUIRES yum-utils" +fi + +rlJournalStart + rlPhaseStartSetup + rlShowRunningKernel + rlAssertRpm --all + rlRun "TmpDir=\$(mktemp -d)" + rlRun "pushd $TmpDir" + rlFetchSrcForInstalled $PACKAGE + rlRun "useradd -M -N $BUILD_USER" 0,9 + [ "$?" == "0" ] && rlRun "del=yes" + rlRun "chown -R $BUILD_USER:users $TmpDir" + rlPhaseEnd + + rlPhaseStartSetup "build libpfm" + rlRun "rpm -D \"_topdir $TmpDir\" -U *.src.rpm" + rlRun "yum-builddep -y $TmpDir/SPECS/*.spec" + rlRun "su -c 'rpmbuild -D \"_topdir $TmpDir\" -bp $TmpDir/SPECS/*.spec &>$TmpDir/rpmbuild.log' $BUILD_USER" + rlRun "rlFileSubmit $TmpDir/rpmbuild.log" + rlRun "cd $TmpDir/BUILD/libpfm-*/tests" + rlRun "su -c 'make PFMLIB=`rpm -ql libpfm | grep .so | head -n 1`' $BUILD_USER" + rlRun "ldd validate | tee $TmpDir/ldd.log" + rlRun "grep -q 'libpfm.so' $TmpDir/ldd.log" + rlPhaseEnd + + rlPhaseStartTest "run testsuite" + rlRun "su -c './validate &>$TmpDir/testsuite.log' $BUILD_USER" + rlRun "rlFileSubmit $TmpDir/testsuite.log" + rlPhaseEnd + + rlPhaseStartTest "evaluate results" + rlRun "cd $TmpDir" + rlRun "grep -q 'All tests passed' testsuite.log" + rlRun "tests_count=\$(grep -o -E '^\s*[0-9]+' testsuite.log | awk '{sum+=\$1} END {print sum}')" + [ "$tests_count" -ge "$TESTS_COUNT_MIN" ] && rlLogInfo "Test counter: $tests_count" || rlFail "Test counter $tests_count should be greater than or equal to $TESTS_COUNT_MIN" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" + [ "$del" == "yes" ] && rlRun "userdel -f $BUILD_USER" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd From abee1be380c20c5b105e3cc30f0394894ab76e5c Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 20 Jan 2022 16:58:00 +0000 Subject: [PATCH 69/94] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index beac79b..9a6177a 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.11.0 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Library to encode performance events for use by perf tool @@ -124,6 +124,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Thu Jan 20 2022 Fedora Release Engineering - 4.11.0-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Thu Jul 22 2021 Fedora Release Engineering - 4.11.0-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From da6000bab90b7caea53fff0972e8e568e060396b Mon Sep 17 00:00:00 2001 From: Python Maint Date: Mon, 13 Jun 2022 15:08:54 +0200 Subject: [PATCH 70/94] Rebuilt for Python 3.11 --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 9a6177a..e6cacf3 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.11.0 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Library to encode performance events for use by perf tool @@ -124,6 +124,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Mon Jun 13 2022 Python Maint - 4.11.0-8 +- Rebuilt for Python 3.11 + * Thu Jan 20 2022 Fedora Release Engineering - 4.11.0-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From 99bed259508cf61fed622eec45f0d5f897532975 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Tue, 21 Jun 2022 12:07:42 -0400 Subject: [PATCH 71/94] Resolve: rhbz2045823 --- libpfm-gcc12.patch | 89 ++++++++++++++++++++++++++++++++++++++++++++++ libpfm.spec | 7 +++- 2 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 libpfm-gcc12.patch diff --git a/libpfm-gcc12.patch b/libpfm-gcc12.patch new file mode 100644 index 0000000..af3bf2c --- /dev/null +++ b/libpfm-gcc12.patch @@ -0,0 +1,89 @@ +commit a7b26272d8327ad1c001456a18518a0ac65dc2bb +Author: Stephane Eranian +Date: Wed Jun 8 06:55:36 2022 -0700 + + avoid GCC-12 use-after-free warnings + + gcc-12 seems to complain about bogus use-after-free situations in the + libpfm4 code: + + p = realloc(q, ...) + if (!p) + return NULL + + s = p + (q - z) + + It complains because of the use of q after realloc in this case. + Yet q - z is just pointer artihmetic and is not dereferencing any + memory through the pointer q which may have been freed by realloc. + + Fix is to pre-computer the delta before realloc to avoid using the + pointer after the call. + + Reported-by: Vitaly Chikunov + Signed-off-by: Stephane Eranian + +diff --git a/lib/pfmlib_perf_event_pmu.c b/lib/pfmlib_perf_event_pmu.c +index c3386aa..637c5b1 100644 +--- a/lib/pfmlib_perf_event_pmu.c ++++ b/lib/pfmlib_perf_event_pmu.c +@@ -268,6 +268,7 @@ perf_table_alloc_event(void) + perf_table_alloc_event(void) + { + perf_event_t *new_pe; ++ size_t num_free; + + retry: + if (perf_pe_free < perf_pe_end) +@@ -286,11 +287,20 @@ retry: + + perf_pe_count += PERF_ALLOC_EVENT_COUNT; + ++ /* ++ * compute number of free events left ++ * before realloc() to avoid compiler warning (use-after-free) ++ * even though we are simply doing pointer arithmetic and not ++ * dereferencing the perf_pe after realloc when it may be stale ++ * in case the memory was moved. ++ */ ++ num_free = perf_pe_free - perf_pe; ++ + new_pe = realloc(perf_pe, perf_pe_count * sizeof(perf_event_t)); + if (!new_pe) + return NULL; + +- perf_pe_free = new_pe + (perf_pe_free - perf_pe); ++ perf_pe_free = new_pe + num_free; + perf_pe_end = perf_pe_free + PERF_ALLOC_EVENT_COUNT; + perf_pe = new_pe; + +@@ -315,18 +325,27 @@ static perf_umask_t * + perf_table_alloc_umask(void) + { + perf_umask_t *new_um; ++ size_t num_free; + + retry: + if (perf_um_free < perf_um_end) + return perf_um_free++; + + perf_um_count += PERF_ALLOC_UMASK_COUNT; +- ++ ++ /* ++ * compute number of free unmasks left ++ * before realloc() to avoid compiler warning (use-after-free) ++ * even though we are simply doing pointer arithmetic and not ++ * dereferencing the perf_um after realloc when it may be stale ++ * in case the memory was moved. ++ */ ++ num_free = perf_um_free - perf_um; + new_um = realloc(perf_um, perf_um_count * sizeof(*new_um)); + if (!new_um) + return NULL; + +- perf_um_free = new_um + (perf_um_free - perf_um); ++ perf_um_free = new_um + num_free; + perf_um_end = perf_um_free + PERF_ALLOC_UMASK_COUNT; + perf_um = new_um; + diff --git a/libpfm.spec b/libpfm.spec index e6cacf3..16e4d66 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.11.0 -Release: 8%{?dist} +Release: 9%{?dist} Summary: Library to encode performance events for use by perf tool @@ -20,6 +20,7 @@ License: MIT URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz Patch2: libpfm-python3-setup.patch +Patch3: libpfm-gcc12.patch BuildRequires: make BuildRequires: gcc @@ -71,6 +72,7 @@ Python bindings for libpfm4 and perf_event_open system call. %prep %setup -q %patch2 -p1 -b .python3 +%patch3 -p1 -b .gcc12 %build %if %{with python} @@ -124,6 +126,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Tue Jun 21 2022 Python Maint - 4.11.0-9 +- Fix FTBFS due to gcc12. (rhbz2045823) + * Mon Jun 13 2022 Python Maint - 4.11.0-8 - Rebuilt for Python 3.11 From fb415892efc712ba8208eb0be76ce36bf1a4c105 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 21 Jul 2022 18:40:28 +0000 Subject: [PATCH 72/94] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 16e4d66..d0d3d7c 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.11.0 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Library to encode performance events for use by perf tool @@ -126,6 +126,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Thu Jul 21 2022 Fedora Release Engineering - 4.11.0-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Tue Jun 21 2022 Python Maint - 4.11.0-9 - Fix FTBFS due to gcc12. (rhbz2045823) From 4e095bbe903c77ca184772fa0a05e4149c3b5c41 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 19 Jan 2023 17:09:29 +0000 Subject: [PATCH 73/94] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index d0d3d7c..679bc06 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.11.0 -Release: 10%{?dist} +Release: 11%{?dist} Summary: Library to encode performance events for use by perf tool @@ -126,6 +126,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Thu Jan 19 2023 Fedora Release Engineering - 4.11.0-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Thu Jul 21 2022 Fedora Release Engineering - 4.11.0-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild From a5d81468548000cb31c6587323494f8870efcb06 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Tue, 14 Mar 2023 10:52:30 -0400 Subject: [PATCH 74/94] Add libpfm upstream patch to allow papi-7.0.1 to build. --- libpfm-kernel518.patch | 266 +++++++++++++++++++++++++++++++++++++++++ libpfm.spec | 7 +- 2 files changed, 272 insertions(+), 1 deletion(-) create mode 100644 libpfm-kernel518.patch diff --git a/libpfm-kernel518.patch b/libpfm-kernel518.patch new file mode 100644 index 0000000..67cc260 --- /dev/null +++ b/libpfm-kernel518.patch @@ -0,0 +1,266 @@ +commit 8c606bc2f2d186c2797d9f013283c9150f594f93 +Author: Masahiko, Yamada +Date: Tue Sep 20 14:04:31 2022 +0900 + + update perf_event.h to Linux 5.18 + + The perf_events interface for directly accessing PMU registers + from userspace for arm64 has been formally implemented in the + kernel v5.18. + + Update perf_event.h header used to build perf_event based examples. + + Signed-off-by: Masahiko Yamada + +diff --git a/include/perfmon/perf_event.h b/include/perfmon/perf_event.h +index 81e02a2..a3bbb14 100644 +--- a/include/perfmon/perf_event.h ++++ b/include/perfmon/perf_event.h +@@ -143,7 +143,12 @@ enum perf_event_sample_format { + PERF_SAMPLE_TRANSACTION = 1U << 17, + PERF_SAMPLE_REGS_INTR = 1U << 18, + PERF_SAMPLE_PHYS_ADDR = 1U << 19, +- PERF_SAMPLE_MAX = 1U << 19, ++ PERF_SAMPLE_AUX = 1U << 20, ++ PERF_SAMPLE_CGROUP = 1U << 21, ++ PERF_SAMPLE_DATA_PAGE_SIZE = 1U << 22, ++ PERF_SAMPLE_CODE_PAGE_SIZE = 1U << 23, ++ PERF_SAMPLE_WEIGHT_STRUCT = 1U << 24, ++ PERF_SAMPLE_MAX = 1U << 25, + }; + enum { + PERF_TXN_ELISION = (1 << 0), +@@ -180,6 +185,7 @@ enum perf_branch_sample_type_shift { + PERF_SAMPLE_BRANCH_NO_FLAGS_SHIFT = 14, + PERF_SAMPLE_BRANCH_NO_CYCLES_SHIFT = 15, + PERF_SAMPLE_BRANCH_TYPE_SAVE_SHIFT = 16, ++ PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT = 17, + + PERF_SAMPLE_BRANCH_MAX_SHIFT /* non-ABI */ + }; +@@ -204,6 +210,7 @@ enum perf_branch_sample_type { + PERF_SAMPLE_BRANCH_NO_FLAGS = 1U << PERF_SAMPLE_BRANCH_NO_FLAGS_SHIFT, + PERF_SAMPLE_BRANCH_NO_CYCLES = 1U << PERF_SAMPLE_BRANCH_NO_CYCLES_SHIFT, + PERF_SAMPLE_BRANCH_TYPE_SAVE = 1U << PERF_SAMPLE_BRANCH_TYPE_SAVE_SHIFT, ++ PERF_SAMPLE_BRANCH_HW_INDEX = 1U << PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT, + + PERF_SAMPLE_BRANCH_MAX = 1U << PERF_SAMPLE_BRANCH_MAX_SHIFT, + }; +@@ -232,6 +239,8 @@ enum perf_event_read_format { + /* add: sample_stack_user */ + #define PERF_ATTR_SIZE_VER4 104 /* add: sample_regs_intr */ + #define PERF_ATTR_SIZE_VER5 112 /* add: aux_watermark */ ++#define PERF_ATTR_SIZE_VER6 120 /* add: aux_sample_size */ ++#define PERF_ATTR_SIZE_VER7 128 /* add: sig_data */ + + + /* +@@ -289,7 +298,16 @@ typedef struct perf_event_attr { + context_switch : 1, + write_backward : 1, + namespaces : 1, +- __reserved_1 : 35; ++ ksymbol : 1, ++ bpf_event : 1, ++ aux_output : 1, ++ cgroup : 1, ++ text_poke : 1, ++ build_id : 1, ++ inherit_thread : 1, ++ remove_on_exec : 1, ++ sigtrap : 1, ++ __reserved_1 : 26; + + union { + uint32_t wakeup_events; +@@ -311,7 +329,11 @@ typedef struct perf_event_attr { + int32_t clockid; + uint64_t sample_regs_intr; + uint32_t aux_watermark; +- uint32_t __reserved_2; ++ uint16_t sample_max_stack; ++ uint16_t __reserved_2; ++ uint32_t aux_sample_size; ++ uint32_t __reserved_3; ++ uint64_t sig_data; + } perf_event_attr_t; + + struct perf_branch_entry { +@@ -340,19 +362,32 @@ struct perf_branch_stack { + struct perf_branch_entry entries[0]; + }; + ++/* ++ * Structure used by below PERF_EVENT_IOC_QUERY_BPF command ++ * to query bpf programs attached to the same perf tracepoint ++ * as the given perf event. ++ */ ++struct perf_event_query_bpf { ++ uint32_t ids_len; ++ uint32_t prog_cnt; ++ uint32_t ids[0]; ++}; ++ + /* + * perf_events ioctl commands, use with event fd + */ +-#define PERF_EVENT_IOC_ENABLE _IO ('$', 0) +-#define PERF_EVENT_IOC_DISABLE _IO ('$', 1) +-#define PERF_EVENT_IOC_REFRESH _IO ('$', 2) +-#define PERF_EVENT_IOC_RESET _IO ('$', 3) +-#define PERF_EVENT_IOC_PERIOD _IOW('$', 4, uint64_t) +-#define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5) +-#define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *) +-#define PERF_EVENT_IOC_ID _IOR('$', 7, uint64_t *) +-#define PERF_EVENT_IOC_SET_BPF _IOW('$', 8, uint32_t) +-#define PERF_EVENT_IOC_PAUSE_OUTPUT _IOW('$', 9, __u32) ++#define PERF_EVENT_IOC_ENABLE _IO ('$', 0) ++#define PERF_EVENT_IOC_DISABLE _IO ('$', 1) ++#define PERF_EVENT_IOC_REFRESH _IO ('$', 2) ++#define PERF_EVENT_IOC_RESET _IO ('$', 3) ++#define PERF_EVENT_IOC_PERIOD _IOW('$', 4, uint64_t) ++#define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5) ++#define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *) ++#define PERF_EVENT_IOC_ID _IOR('$', 7, uint64_t *) ++#define PERF_EVENT_IOC_SET_BPF _IOW('$', 8, uint32_t) ++#define PERF_EVENT_IOC_PAUSE_OUTPUT _IOW('$', 9, __u32) ++#define PERF_EVENT_IOC_QUERY_BPF _IOWR('$', 10, struct perf_event_query_bpf *) ++#define PERF_EVENT_IOC_MODIFY_ATTRIBUTES _IOW('$', 11, struct perf_event_attr *) + + /* + * ioctl() 3rd argument +@@ -381,7 +416,8 @@ struct perf_event_mmap_page { + cap_usr_rdpmc:1, + cap_user_time:1, + cap_user_time_zero:1, +- cap_____res:59; ++ cap_user_time_short:1, ++ cap_____res:58; + } SWIG_NAME(rdmap_cap_s); + } SWIG_NAME(rdmap_cap_u); + uint16_t pmc_width; +@@ -391,7 +427,10 @@ struct perf_event_mmap_page { + + uint64_t time_zero; + uint32_t size; +- uint8_t __reserved[118*8+4]; ++ uint32_t __reserved_1; ++ uint64_t time_cycles; ++ uint64_t time_mask; ++ uint8_t __reserved[116*8]; + + uint64_t data_head; + uint64_t data_tail; +@@ -450,9 +489,38 @@ enum perf_event_type { + PERF_RECORD_SWITCH = 14, + PERF_RECORD_SWITCH_CPU_WIDE = 15, + PERF_RECORD_NAMESPACES = 16, ++ PERF_RECORD_KSYMBOL = 17, ++ PERF_RECORD_BPF_EVENT = 18, ++ PERF_RECORD_CGROUP = 19, ++ PERF_RECORD_TEXT_POKE = 20, ++ PERF_RECORD_AUX_OUTPUT_HW_ID = 21, + PERF_RECORD_MAX + }; + ++enum perf_record_ksymbol_type { ++ PERF_RECORD_KSYMBOL_TYPE_UNKNOWN = 0, ++ PERF_RECORD_KSYMBOL_TYPE_BPF = 1, ++ /* ++ * Out of line code such as kprobe-replaced instructions or optimized ++ * kprobes or ftrace trampolines. ++ */ ++ PERF_RECORD_KSYMBOL_TYPE_OOL = 2, ++ PERF_RECORD_KSYMBOL_TYPE_MAX /* non-ABI */ ++}; ++ ++#define PERF_RECORD_KSYMBOL_FLAGS_UNREGISTER (1 << 0) ++ ++enum perf_bpf_event_type { ++ PERF_BPF_EVENT_UNKNOWN = 0, ++ PERF_BPF_EVENT_PROG_LOAD = 1, ++ PERF_BPF_EVENT_PROG_UNLOAD = 2, ++ PERF_BPF_EVENT_MAX, /* non-ABI */ ++}; ++ ++#define PERF_MAX_STACK_DEPTH 127 ++#define PERF_MAX_CONTEXTS_PER_STACK 8 ++ ++ + enum perf_callchain_context { + PERF_CONTEXT_HV = (uint64_t)-32, + PERF_CONTEXT_KERNEL = (uint64_t)-128, +@@ -465,8 +533,16 @@ enum perf_callchain_context { + PERF_CONTEXT_MAX = (uint64_t)-4095, + }; + +-#define PERF_AUX_FLAG_TRUNCATED 0x01 +-#define PERF_AUX_FLAG_OVERWRITE 0x02 ++#define PERF_AUX_FLAG_TRUNCATED 0x01 ++#define PERF_AUX_FLAG_OVERWRITE 0x02 ++#define PERF_AUX_FLAG_PARTIAL 0x04 ++#define PERF_AUX_FLAG_COLLISION 0x08 ++#define PERF_AUX_FLAG_PMU_FORMAT_TYPE_MASK 0xff00 ++ ++/* CoreSight PMU AUX buffer formats */ ++#define PERF_AUX_FLAG_CORESIGHT_FORMAT_CORESIGHT 0x0000 ++#define PERF_AUX_FLAG_CORESIGHT_FORMAT_RAW 0x0100 ++ + + /* + * flags for perf_event_open() +@@ -544,12 +620,17 @@ perf_event_open( + union perf_mem_data_src { + uint64_t val; + struct { +- uint64_t mem_op:5, /* type of opcode */ +- mem_lvl:14, /* memory hierarchy level */ +- mem_snoop:5, /* snoop mode */ +- mem_lock:2, /* lock instr */ +- mem_dtlb:7, /* tlb access */ +- mem_rsvd:31; ++ uint64_t mem_op:5, /* type of opcode */ ++ mem_lvl:14, /* memory hierarchy level */ ++ mem_snoop:5, /* snoop mode */ ++ mem_lock:2, /* lock instr */ ++ mem_dtlb:7, /* tlb access */ ++ mem_lvl_num:4, /* memory hierarchy level number */ ++ mem_remote:1, /* remote */ ++ mem_snoopx:2, /* snoop mode, ext */ ++ mem_blk:3, /* access blocked */ ++ mem_hops:3, /* hop level */ ++ mem_rsvd:18; + }; + }; + +@@ -590,7 +671,8 @@ union perf_mem_data_src { + #define PERF_MEM_SNOOP_SHIFT 19 + + #define PERF_MEM_SNOOPX_FWD 0x01 /* forward */ +-#define PERF_MEM_SNOOPX_SHIFT 37 ++/* 1 free */ ++#define PERF_MEM_SNOOPX_SHIFT 38 + + /* locked instruction */ + #define PERF_MEM_LOCK_NA 0x01 /* not available */ +@@ -607,6 +689,20 @@ union perf_mem_data_src { + #define PERF_MEM_TLB_OS 0x40 /* OS fault handler */ + #define PERF_MEM_TLB_SHIFT 26 + ++/* Access blocked */ ++#define PERF_MEM_BLK_NA 0x01 /* not available */ ++#define PERF_MEM_BLK_DATA 0x02 /* data could not be forwarded */ ++#define PERF_MEM_BLK_ADDR 0x04 /* address conflict */ ++#define PERF_MEM_BLK_SHIFT 40 ++ ++/* hop level */ ++#define PERF_MEM_HOPS_0 0x01 /* remote core, same node */ ++#define PERF_MEM_HOPS_1 0x02 /* remote node, same socket */ ++#define PERF_MEM_HOPS_2 0x03 /* remote socket, same board */ ++#define PERF_MEM_HOPS_3 0x04 /* remote board */ ++/* 5-7 available */ ++#define PERF_MEM_HOPS_SHIFT 43 ++ + #define PERF_MEM_S(a, s) \ + (((u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT) + diff --git a/libpfm.spec b/libpfm.spec index 679bc06..bb1fa70 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.11.0 -Release: 11%{?dist} +Release: 12%{?dist} Summary: Library to encode performance events for use by perf tool @@ -21,6 +21,7 @@ URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz Patch2: libpfm-python3-setup.patch Patch3: libpfm-gcc12.patch +Patch4: libpfm-kernel518.patch BuildRequires: make BuildRequires: gcc @@ -73,6 +74,7 @@ Python bindings for libpfm4 and perf_event_open system call. %setup -q %patch2 -p1 -b .python3 %patch3 -p1 -b .gcc12 +%patch4 -p1 -b .kernel518 %build %if %{with python} @@ -126,6 +128,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Tue Mar 14 2023 William Cohen - 4.11.0-12 +- Add libpfm upstream patch to allow papi-7.0.1 to build. + * Thu Jan 19 2023 Fedora Release Engineering - 4.11.0-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild From face84c751eeb8488ba37dd603eda6294104f5c9 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Tue, 28 Mar 2023 23:31:46 -0400 Subject: [PATCH 75/94] Rebase on libpfm-4.13.0. --- .gitignore | 1 + libpfm-gcc12.patch | 89 -------------- libpfm-kernel518.patch | 266 ----------------------------------------- libpfm.spec | 11 +- sources | 2 +- 5 files changed, 7 insertions(+), 362 deletions(-) delete mode 100644 libpfm-gcc12.patch delete mode 100644 libpfm-kernel518.patch diff --git a/.gitignore b/.gitignore index df137f8..0f753c1 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ /libpfm-4.10.0.tar.gz /libpfm-4.10.1.tar.gz /libpfm-4.11.0.tar.gz +/libpfm-4.13.0.tar.gz diff --git a/libpfm-gcc12.patch b/libpfm-gcc12.patch deleted file mode 100644 index af3bf2c..0000000 --- a/libpfm-gcc12.patch +++ /dev/null @@ -1,89 +0,0 @@ -commit a7b26272d8327ad1c001456a18518a0ac65dc2bb -Author: Stephane Eranian -Date: Wed Jun 8 06:55:36 2022 -0700 - - avoid GCC-12 use-after-free warnings - - gcc-12 seems to complain about bogus use-after-free situations in the - libpfm4 code: - - p = realloc(q, ...) - if (!p) - return NULL - - s = p + (q - z) - - It complains because of the use of q after realloc in this case. - Yet q - z is just pointer artihmetic and is not dereferencing any - memory through the pointer q which may have been freed by realloc. - - Fix is to pre-computer the delta before realloc to avoid using the - pointer after the call. - - Reported-by: Vitaly Chikunov - Signed-off-by: Stephane Eranian - -diff --git a/lib/pfmlib_perf_event_pmu.c b/lib/pfmlib_perf_event_pmu.c -index c3386aa..637c5b1 100644 ---- a/lib/pfmlib_perf_event_pmu.c -+++ b/lib/pfmlib_perf_event_pmu.c -@@ -268,6 +268,7 @@ perf_table_alloc_event(void) - perf_table_alloc_event(void) - { - perf_event_t *new_pe; -+ size_t num_free; - - retry: - if (perf_pe_free < perf_pe_end) -@@ -286,11 +287,20 @@ retry: - - perf_pe_count += PERF_ALLOC_EVENT_COUNT; - -+ /* -+ * compute number of free events left -+ * before realloc() to avoid compiler warning (use-after-free) -+ * even though we are simply doing pointer arithmetic and not -+ * dereferencing the perf_pe after realloc when it may be stale -+ * in case the memory was moved. -+ */ -+ num_free = perf_pe_free - perf_pe; -+ - new_pe = realloc(perf_pe, perf_pe_count * sizeof(perf_event_t)); - if (!new_pe) - return NULL; - -- perf_pe_free = new_pe + (perf_pe_free - perf_pe); -+ perf_pe_free = new_pe + num_free; - perf_pe_end = perf_pe_free + PERF_ALLOC_EVENT_COUNT; - perf_pe = new_pe; - -@@ -315,18 +325,27 @@ static perf_umask_t * - perf_table_alloc_umask(void) - { - perf_umask_t *new_um; -+ size_t num_free; - - retry: - if (perf_um_free < perf_um_end) - return perf_um_free++; - - perf_um_count += PERF_ALLOC_UMASK_COUNT; -- -+ -+ /* -+ * compute number of free unmasks left -+ * before realloc() to avoid compiler warning (use-after-free) -+ * even though we are simply doing pointer arithmetic and not -+ * dereferencing the perf_um after realloc when it may be stale -+ * in case the memory was moved. -+ */ -+ num_free = perf_um_free - perf_um; - new_um = realloc(perf_um, perf_um_count * sizeof(*new_um)); - if (!new_um) - return NULL; - -- perf_um_free = new_um + (perf_um_free - perf_um); -+ perf_um_free = new_um + num_free; - perf_um_end = perf_um_free + PERF_ALLOC_UMASK_COUNT; - perf_um = new_um; - diff --git a/libpfm-kernel518.patch b/libpfm-kernel518.patch deleted file mode 100644 index 67cc260..0000000 --- a/libpfm-kernel518.patch +++ /dev/null @@ -1,266 +0,0 @@ -commit 8c606bc2f2d186c2797d9f013283c9150f594f93 -Author: Masahiko, Yamada -Date: Tue Sep 20 14:04:31 2022 +0900 - - update perf_event.h to Linux 5.18 - - The perf_events interface for directly accessing PMU registers - from userspace for arm64 has been formally implemented in the - kernel v5.18. - - Update perf_event.h header used to build perf_event based examples. - - Signed-off-by: Masahiko Yamada - -diff --git a/include/perfmon/perf_event.h b/include/perfmon/perf_event.h -index 81e02a2..a3bbb14 100644 ---- a/include/perfmon/perf_event.h -+++ b/include/perfmon/perf_event.h -@@ -143,7 +143,12 @@ enum perf_event_sample_format { - PERF_SAMPLE_TRANSACTION = 1U << 17, - PERF_SAMPLE_REGS_INTR = 1U << 18, - PERF_SAMPLE_PHYS_ADDR = 1U << 19, -- PERF_SAMPLE_MAX = 1U << 19, -+ PERF_SAMPLE_AUX = 1U << 20, -+ PERF_SAMPLE_CGROUP = 1U << 21, -+ PERF_SAMPLE_DATA_PAGE_SIZE = 1U << 22, -+ PERF_SAMPLE_CODE_PAGE_SIZE = 1U << 23, -+ PERF_SAMPLE_WEIGHT_STRUCT = 1U << 24, -+ PERF_SAMPLE_MAX = 1U << 25, - }; - enum { - PERF_TXN_ELISION = (1 << 0), -@@ -180,6 +185,7 @@ enum perf_branch_sample_type_shift { - PERF_SAMPLE_BRANCH_NO_FLAGS_SHIFT = 14, - PERF_SAMPLE_BRANCH_NO_CYCLES_SHIFT = 15, - PERF_SAMPLE_BRANCH_TYPE_SAVE_SHIFT = 16, -+ PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT = 17, - - PERF_SAMPLE_BRANCH_MAX_SHIFT /* non-ABI */ - }; -@@ -204,6 +210,7 @@ enum perf_branch_sample_type { - PERF_SAMPLE_BRANCH_NO_FLAGS = 1U << PERF_SAMPLE_BRANCH_NO_FLAGS_SHIFT, - PERF_SAMPLE_BRANCH_NO_CYCLES = 1U << PERF_SAMPLE_BRANCH_NO_CYCLES_SHIFT, - PERF_SAMPLE_BRANCH_TYPE_SAVE = 1U << PERF_SAMPLE_BRANCH_TYPE_SAVE_SHIFT, -+ PERF_SAMPLE_BRANCH_HW_INDEX = 1U << PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT, - - PERF_SAMPLE_BRANCH_MAX = 1U << PERF_SAMPLE_BRANCH_MAX_SHIFT, - }; -@@ -232,6 +239,8 @@ enum perf_event_read_format { - /* add: sample_stack_user */ - #define PERF_ATTR_SIZE_VER4 104 /* add: sample_regs_intr */ - #define PERF_ATTR_SIZE_VER5 112 /* add: aux_watermark */ -+#define PERF_ATTR_SIZE_VER6 120 /* add: aux_sample_size */ -+#define PERF_ATTR_SIZE_VER7 128 /* add: sig_data */ - - - /* -@@ -289,7 +298,16 @@ typedef struct perf_event_attr { - context_switch : 1, - write_backward : 1, - namespaces : 1, -- __reserved_1 : 35; -+ ksymbol : 1, -+ bpf_event : 1, -+ aux_output : 1, -+ cgroup : 1, -+ text_poke : 1, -+ build_id : 1, -+ inherit_thread : 1, -+ remove_on_exec : 1, -+ sigtrap : 1, -+ __reserved_1 : 26; - - union { - uint32_t wakeup_events; -@@ -311,7 +329,11 @@ typedef struct perf_event_attr { - int32_t clockid; - uint64_t sample_regs_intr; - uint32_t aux_watermark; -- uint32_t __reserved_2; -+ uint16_t sample_max_stack; -+ uint16_t __reserved_2; -+ uint32_t aux_sample_size; -+ uint32_t __reserved_3; -+ uint64_t sig_data; - } perf_event_attr_t; - - struct perf_branch_entry { -@@ -340,19 +362,32 @@ struct perf_branch_stack { - struct perf_branch_entry entries[0]; - }; - -+/* -+ * Structure used by below PERF_EVENT_IOC_QUERY_BPF command -+ * to query bpf programs attached to the same perf tracepoint -+ * as the given perf event. -+ */ -+struct perf_event_query_bpf { -+ uint32_t ids_len; -+ uint32_t prog_cnt; -+ uint32_t ids[0]; -+}; -+ - /* - * perf_events ioctl commands, use with event fd - */ --#define PERF_EVENT_IOC_ENABLE _IO ('$', 0) --#define PERF_EVENT_IOC_DISABLE _IO ('$', 1) --#define PERF_EVENT_IOC_REFRESH _IO ('$', 2) --#define PERF_EVENT_IOC_RESET _IO ('$', 3) --#define PERF_EVENT_IOC_PERIOD _IOW('$', 4, uint64_t) --#define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5) --#define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *) --#define PERF_EVENT_IOC_ID _IOR('$', 7, uint64_t *) --#define PERF_EVENT_IOC_SET_BPF _IOW('$', 8, uint32_t) --#define PERF_EVENT_IOC_PAUSE_OUTPUT _IOW('$', 9, __u32) -+#define PERF_EVENT_IOC_ENABLE _IO ('$', 0) -+#define PERF_EVENT_IOC_DISABLE _IO ('$', 1) -+#define PERF_EVENT_IOC_REFRESH _IO ('$', 2) -+#define PERF_EVENT_IOC_RESET _IO ('$', 3) -+#define PERF_EVENT_IOC_PERIOD _IOW('$', 4, uint64_t) -+#define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5) -+#define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *) -+#define PERF_EVENT_IOC_ID _IOR('$', 7, uint64_t *) -+#define PERF_EVENT_IOC_SET_BPF _IOW('$', 8, uint32_t) -+#define PERF_EVENT_IOC_PAUSE_OUTPUT _IOW('$', 9, __u32) -+#define PERF_EVENT_IOC_QUERY_BPF _IOWR('$', 10, struct perf_event_query_bpf *) -+#define PERF_EVENT_IOC_MODIFY_ATTRIBUTES _IOW('$', 11, struct perf_event_attr *) - - /* - * ioctl() 3rd argument -@@ -381,7 +416,8 @@ struct perf_event_mmap_page { - cap_usr_rdpmc:1, - cap_user_time:1, - cap_user_time_zero:1, -- cap_____res:59; -+ cap_user_time_short:1, -+ cap_____res:58; - } SWIG_NAME(rdmap_cap_s); - } SWIG_NAME(rdmap_cap_u); - uint16_t pmc_width; -@@ -391,7 +427,10 @@ struct perf_event_mmap_page { - - uint64_t time_zero; - uint32_t size; -- uint8_t __reserved[118*8+4]; -+ uint32_t __reserved_1; -+ uint64_t time_cycles; -+ uint64_t time_mask; -+ uint8_t __reserved[116*8]; - - uint64_t data_head; - uint64_t data_tail; -@@ -450,9 +489,38 @@ enum perf_event_type { - PERF_RECORD_SWITCH = 14, - PERF_RECORD_SWITCH_CPU_WIDE = 15, - PERF_RECORD_NAMESPACES = 16, -+ PERF_RECORD_KSYMBOL = 17, -+ PERF_RECORD_BPF_EVENT = 18, -+ PERF_RECORD_CGROUP = 19, -+ PERF_RECORD_TEXT_POKE = 20, -+ PERF_RECORD_AUX_OUTPUT_HW_ID = 21, - PERF_RECORD_MAX - }; - -+enum perf_record_ksymbol_type { -+ PERF_RECORD_KSYMBOL_TYPE_UNKNOWN = 0, -+ PERF_RECORD_KSYMBOL_TYPE_BPF = 1, -+ /* -+ * Out of line code such as kprobe-replaced instructions or optimized -+ * kprobes or ftrace trampolines. -+ */ -+ PERF_RECORD_KSYMBOL_TYPE_OOL = 2, -+ PERF_RECORD_KSYMBOL_TYPE_MAX /* non-ABI */ -+}; -+ -+#define PERF_RECORD_KSYMBOL_FLAGS_UNREGISTER (1 << 0) -+ -+enum perf_bpf_event_type { -+ PERF_BPF_EVENT_UNKNOWN = 0, -+ PERF_BPF_EVENT_PROG_LOAD = 1, -+ PERF_BPF_EVENT_PROG_UNLOAD = 2, -+ PERF_BPF_EVENT_MAX, /* non-ABI */ -+}; -+ -+#define PERF_MAX_STACK_DEPTH 127 -+#define PERF_MAX_CONTEXTS_PER_STACK 8 -+ -+ - enum perf_callchain_context { - PERF_CONTEXT_HV = (uint64_t)-32, - PERF_CONTEXT_KERNEL = (uint64_t)-128, -@@ -465,8 +533,16 @@ enum perf_callchain_context { - PERF_CONTEXT_MAX = (uint64_t)-4095, - }; - --#define PERF_AUX_FLAG_TRUNCATED 0x01 --#define PERF_AUX_FLAG_OVERWRITE 0x02 -+#define PERF_AUX_FLAG_TRUNCATED 0x01 -+#define PERF_AUX_FLAG_OVERWRITE 0x02 -+#define PERF_AUX_FLAG_PARTIAL 0x04 -+#define PERF_AUX_FLAG_COLLISION 0x08 -+#define PERF_AUX_FLAG_PMU_FORMAT_TYPE_MASK 0xff00 -+ -+/* CoreSight PMU AUX buffer formats */ -+#define PERF_AUX_FLAG_CORESIGHT_FORMAT_CORESIGHT 0x0000 -+#define PERF_AUX_FLAG_CORESIGHT_FORMAT_RAW 0x0100 -+ - - /* - * flags for perf_event_open() -@@ -544,12 +620,17 @@ perf_event_open( - union perf_mem_data_src { - uint64_t val; - struct { -- uint64_t mem_op:5, /* type of opcode */ -- mem_lvl:14, /* memory hierarchy level */ -- mem_snoop:5, /* snoop mode */ -- mem_lock:2, /* lock instr */ -- mem_dtlb:7, /* tlb access */ -- mem_rsvd:31; -+ uint64_t mem_op:5, /* type of opcode */ -+ mem_lvl:14, /* memory hierarchy level */ -+ mem_snoop:5, /* snoop mode */ -+ mem_lock:2, /* lock instr */ -+ mem_dtlb:7, /* tlb access */ -+ mem_lvl_num:4, /* memory hierarchy level number */ -+ mem_remote:1, /* remote */ -+ mem_snoopx:2, /* snoop mode, ext */ -+ mem_blk:3, /* access blocked */ -+ mem_hops:3, /* hop level */ -+ mem_rsvd:18; - }; - }; - -@@ -590,7 +671,8 @@ union perf_mem_data_src { - #define PERF_MEM_SNOOP_SHIFT 19 - - #define PERF_MEM_SNOOPX_FWD 0x01 /* forward */ --#define PERF_MEM_SNOOPX_SHIFT 37 -+/* 1 free */ -+#define PERF_MEM_SNOOPX_SHIFT 38 - - /* locked instruction */ - #define PERF_MEM_LOCK_NA 0x01 /* not available */ -@@ -607,6 +689,20 @@ union perf_mem_data_src { - #define PERF_MEM_TLB_OS 0x40 /* OS fault handler */ - #define PERF_MEM_TLB_SHIFT 26 - -+/* Access blocked */ -+#define PERF_MEM_BLK_NA 0x01 /* not available */ -+#define PERF_MEM_BLK_DATA 0x02 /* data could not be forwarded */ -+#define PERF_MEM_BLK_ADDR 0x04 /* address conflict */ -+#define PERF_MEM_BLK_SHIFT 40 -+ -+/* hop level */ -+#define PERF_MEM_HOPS_0 0x01 /* remote core, same node */ -+#define PERF_MEM_HOPS_1 0x02 /* remote node, same socket */ -+#define PERF_MEM_HOPS_2 0x03 /* remote socket, same board */ -+#define PERF_MEM_HOPS_3 0x04 /* remote board */ -+/* 5-7 available */ -+#define PERF_MEM_HOPS_SHIFT 43 -+ - #define PERF_MEM_S(a, s) \ - (((u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT) - diff --git a/libpfm.spec b/libpfm.spec index bb1fa70..8d6e2c4 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -11,8 +11,8 @@ %endif Name: libpfm -Version: 4.11.0 -Release: 12%{?dist} +Version: 4.13.0 +Release: 1%{?dist} Summary: Library to encode performance events for use by perf tool @@ -20,8 +20,6 @@ License: MIT URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz Patch2: libpfm-python3-setup.patch -Patch3: libpfm-gcc12.patch -Patch4: libpfm-kernel518.patch BuildRequires: make BuildRequires: gcc @@ -73,8 +71,6 @@ Python bindings for libpfm4 and perf_event_open system call. %prep %setup -q %patch2 -p1 -b .python3 -%patch3 -p1 -b .gcc12 -%patch4 -p1 -b .kernel518 %build %if %{with python} @@ -128,6 +124,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Tue Mar 28 2023 William Cohen - 4.13.0-1 +- Rebase on libpfm-4.13.0. + * Tue Mar 14 2023 William Cohen - 4.11.0-12 - Add libpfm upstream patch to allow papi-7.0.1 to build. diff --git a/sources b/sources index 3d5afdf..b2d4ea3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libpfm-4.11.0.tar.gz) = 633035b8a7b35973437572095cdc80d422b2a1a61e74e14f106db95fa8e44e4518e591699cc457f828b8f2fb63f60eef6d0c7535c6b4c9a6c3a70d4550b3c3c7 +SHA512 (libpfm-4.13.0.tar.gz) = e61b210aa2ce80f0e47603c88eee2e4f2fe30ca2c0e194a5472b6a8de3bf9dc1085e5261bbb9ddbe5b6531c4b391fb34f20d038e5ebd8e6f4c14c2112aee508f From 0f9c88b81f951d126ac2c53f7fdf24ca24c0d1ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 25 Apr 2023 14:13:18 +0200 Subject: [PATCH 76/94] Don't install a Python .egg Due to an upcoming deprecation of .eggs in pip, we'd like to avoid all Python .eggs in Fedora. setuptools forces installation of an .egg when --prefix is set without --root. To make this work, we set the make's DESTDIR variable rather than prefixing other values with it. To assert this works, we list the Python files explicitly, as required by https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_explicit_lists --- libpfm.spec | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index 8d6e2c4..66d92f4 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.13.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library to encode performance events for use by perf tool @@ -71,6 +71,10 @@ Python bindings for libpfm4 and perf_event_open system call. %prep %setup -q %patch2 -p1 -b .python3 +# to prevent setuptools from installing an .egg, we need to pass --root to setup.py install +# see https://github.com/pypa/setuptools/issues/3143 +# and https://github.com/pypa/pip/issues/11501 +sed -i 's/--prefix=$(DESTDIR)$(PYTHON_PREFIX)/--root=$(DESTDIR) --prefix=$(PYTHON_PREFIX)/' python/Makefile %build %if %{with python} @@ -86,14 +90,15 @@ Python bindings for libpfm4 and perf_event_open system call. rm -rf $RPM_BUILD_ROOT %if %{with python} -%global python_config CONFIG_PFMLIB_NOPYTHON=n PYTHON_PREFIX=$RPM_BUILD_ROOT/%{python_prefix} +%global python_config CONFIG_PFMLIB_NOPYTHON=n PYTHON_PREFIX=%{python_prefix} %else %global python_config CONFIG_PFMLIB_NOPYTHON=y %endif make \ - PREFIX=$RPM_BUILD_ROOT%{_prefix} \ - LIBDIR=$RPM_BUILD_ROOT%{_libdir} \ + DESTDIR=$RPM_BUILD_ROOT \ + PREFIX=%{_prefix} \ + LIBDIR=%{_libdir} \ %{python_config} \ LDCONFIG=/bin/true \ install @@ -120,10 +125,14 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %if %{with python} %files -n python3-libpfm -%{python3_sitearch}/* +%{python3_sitearch}/perfmon-*.egg-info/ +%{python3_sitearch}/perfmon/ %endif %changelog +* Tue Apr 25 2023 Miro Hrončok - 4.13.0-2 +- Don't install a Python .egg + * Tue Mar 28 2023 William Cohen - 4.13.0-1 - Rebase on libpfm-4.13.0. From 2d5dcdf0e7fe33efea8e0da642fbd4f43a736751 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Tue, 13 Jun 2023 20:43:09 +0200 Subject: [PATCH 77/94] Rebuilt for Python 3.12 --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 66d92f4..d806936 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.13.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Library to encode performance events for use by perf tool @@ -130,6 +130,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Tue Jun 13 2023 Python Maint - 4.13.0-3 +- Rebuilt for Python 3.12 + * Tue Apr 25 2023 Miro Hrončok - 4.13.0-2 - Don't install a Python .egg From 22274b8db4c93af0f63611d8ba5ebb4f43466490 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 20 Jul 2023 11:45:57 +0000 Subject: [PATCH 78/94] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index d806936..baec9e3 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.13.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Library to encode performance events for use by perf tool @@ -130,6 +130,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Thu Jul 20 2023 Fedora Release Engineering - 4.13.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Tue Jun 13 2023 Python Maint - 4.13.0-3 - Rebuilt for Python 3.12 From 109072acb0151a65f618f627957f23685d13f615 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Tue, 1 Aug 2023 09:48:34 -0400 Subject: [PATCH 79/94] migrated to SPDX license --- libpfm.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index baec9e3..0bb1e41 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.13.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Library to encode performance events for use by perf tool @@ -37,6 +37,7 @@ kernels performance monitoring interfaces. The current version provides support for the perf_events interface available in upstream Linux kernels since v2.6.31. %package devel +License: MIT Summary: Development library to encode performance events for perf_events based tools Requires: %{name}%{?_isa} = %{version}-%{release} @@ -46,6 +47,7 @@ applications for the perf_events interface. %if %{with_static} %package static +License: MIT Summary: Static library to encode performance events for perf_events based tools Requires: %{name}%{?_isa} = %{version}-%{release} @@ -56,6 +58,7 @@ applications for the perf_events interface. %if %{with python} %package -n python3-libpfm +License: MIT AND LicenseRef-Fedora-UltraPermissive %{?python_provide:%python_provide python3-libpfm} # Remove before F30 Provides: %{name}-python = %{version}-%{release} @@ -130,6 +133,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Tue Aug 1 2023 William Cohen - 4.13.0-5 +- migrated to SPDX license + * Thu Jul 20 2023 Fedora Release Engineering - 4.13.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild From 0697d01219e46a0c4cf4b72aff06385fedf4e519 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 21 Jan 2024 05:00:03 +0000 Subject: [PATCH 80/94] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 0bb1e41..51cd03a 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.13.0 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Library to encode performance events for use by perf tool @@ -133,6 +133,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Sun Jan 21 2024 Fedora Release Engineering - 4.13.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Tue Aug 1 2023 William Cohen - 4.13.0-5 - migrated to SPDX license From 461c2dd0bd9a31f0f6e7c5755804e6f97a2354ef Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 25 Jan 2024 03:13:09 +0000 Subject: [PATCH 81/94] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 51cd03a..699adb1 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.13.0 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Library to encode performance events for use by perf tool @@ -133,6 +133,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Thu Jan 25 2024 Fedora Release Engineering - 4.13.0-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Sun Jan 21 2024 Fedora Release Engineering - 4.13.0-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From dcb84740cd296a92ffc8598b7318faa6c457096a Mon Sep 17 00:00:00 2001 From: William Cohen Date: Mon, 29 Jan 2024 16:34:57 -0500 Subject: [PATCH 82/94] Fix gcc-14 -Werror=calloc-transposed-args compatibility --- libpfm-gcc14.patch | 21 +++++++++++++++++++++ libpfm.spec | 9 +++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 libpfm-gcc14.patch diff --git a/libpfm-gcc14.patch b/libpfm-gcc14.patch new file mode 100644 index 0000000..9f2a62d --- /dev/null +++ b/libpfm-gcc14.patch @@ -0,0 +1,21 @@ +commit cb944829e0940d74009e09b8985b4f2139f5cb3b +Author: William Cohen +Date: Mon Jan 29 16:23:43 2024 -0500 + + Correct s390x code to avoid GCC-14 -Werror=calloc-transposed-args errors + +diff --git a/lib/pfmlib_s390x_cpumf.c b/lib/pfmlib_s390x_cpumf.c +index d8ce22d..718f5f8 100644 +--- a/lib/pfmlib_s390x_cpumf.c ++++ b/lib/pfmlib_s390x_cpumf.c +@@ -216,8 +216,8 @@ static int pfm_cpumcf_init(void *this) + break; + } + +- cpumcf_pe = calloc(sizeof(*cpumcf_pe), +- cfvn_set_count + csvn_set_count + ext_set_count); ++ cpumcf_pe = calloc(cfvn_set_count + csvn_set_count + ext_set_count, ++ sizeof(*cpumcf_pe)); + if (cpumcf_pe == NULL) + return PFM_ERR_NOMEM; + diff --git a/libpfm.spec b/libpfm.spec index 699adb1..bd80765 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -12,7 +12,7 @@ Name: libpfm Version: 4.13.0 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Library to encode performance events for use by perf tool @@ -20,6 +20,7 @@ License: MIT URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz Patch2: libpfm-python3-setup.patch +Patch3: libpfm-gcc14.patch BuildRequires: make BuildRequires: gcc @@ -73,7 +74,8 @@ Python bindings for libpfm4 and perf_event_open system call. %prep %setup -q -%patch2 -p1 -b .python3 +%patch -P2 -p1 -b .python3 +%patch -P3 -p1 -b .gcc14 # to prevent setuptools from installing an .egg, we need to pass --root to setup.py install # see https://github.com/pypa/setuptools/issues/3143 # and https://github.com/pypa/pip/issues/11501 @@ -133,6 +135,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Mon Jan 29 2024 William Cohen - 4.13.0-8 +- Fix gcc-14 -Werror=calloc-transposed-args compatibility + * Thu Jan 25 2024 Fedora Release Engineering - 4.13.0-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From e8e4c2f2e9a0db1b35984de163068639facadb7c Mon Sep 17 00:00:00 2001 From: Michal Kolar Date: Fri, 2 Feb 2024 09:11:21 +0000 Subject: [PATCH 83/94] plans/ci.fmf: fix deprecated fmf plan attribute --- plans/ci.fmf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plans/ci.fmf b/plans/ci.fmf index 1ad2c12..3fd3ab7 100644 --- a/plans/ci.fmf +++ b/plans/ci.fmf @@ -1,6 +1,5 @@ summary: CI Gating Plan discover: how: fmf - directory: tests execute: - how: beakerlib + how: tmt From 5b33854516e671b5dcc693b4d4c4ed5b5ffbc303 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 23 Jan 2024 15:47:16 -0500 Subject: [PATCH 84/94] Modernize provides filter https://docs.fedoraproject.org/en-US/packaging-guidelines/AutoProvidesAndRequiresFiltering/ --- libpfm.spec | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libpfm.spec b/libpfm.spec index bd80765..093ff6e 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -4,10 +4,7 @@ %if %{with python} %define python_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %define python_prefix %(python3 -c "import sys; print (sys.prefix)") -%{?filter_setup: -%filter_provides_in %{python3_sitearch}/perfmon/.*\.so$ -%filter_setup -} +%global __provides_exclude_from ^%{python3_sitearch}/perfmon/.*\.so$ %endif Name: libpfm From 9c38e7ca4d14ddecd9137e45b475a3173de67b1b Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 7 Jun 2024 08:51:39 +0200 Subject: [PATCH 85/94] Rebuilt for Python 3.13 --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 093ff6e..ebd1d73 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,7 +9,7 @@ Name: libpfm Version: 4.13.0 -Release: 8%{?dist} +Release: 9%{?dist} Summary: Library to encode performance events for use by perf tool @@ -132,6 +132,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Fri Jun 07 2024 Python Maint - 4.13.0-9 +- Rebuilt for Python 3.13 + * Mon Jan 29 2024 William Cohen - 4.13.0-8 - Fix gcc-14 -Werror=calloc-transposed-args compatibility From d9915b348de8759e2a31690c755d23cb1882434a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 18 Jul 2024 14:46:25 +0000 Subject: [PATCH 86/94] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index ebd1d73..afcbc0d 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,7 +9,7 @@ Name: libpfm Version: 4.13.0 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Library to encode performance events for use by perf tool @@ -132,6 +132,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Thu Jul 18 2024 Fedora Release Engineering - 4.13.0-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Fri Jun 07 2024 Python Maint - 4.13.0-9 - Rebuilt for Python 3.13 From c9663bf9f8d06cf44a0a055ff1480f3b9448bef4 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jan 2025 12:58:01 +0000 Subject: [PATCH 87/94] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index afcbc0d..10c14f9 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,7 +9,7 @@ Name: libpfm Version: 4.13.0 -Release: 10%{?dist} +Release: 11%{?dist} Summary: Library to encode performance events for use by perf tool @@ -132,6 +132,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Fri Jan 17 2025 Fedora Release Engineering - 4.13.0-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Thu Jul 18 2024 Fedora Release Engineering - 4.13.0-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From fab74e854f1a6f0106eea0746fc92e568a8e3179 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Mon, 2 Jun 2025 20:26:21 +0200 Subject: [PATCH 88/94] Rebuilt for Python 3.14 --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 10c14f9..d478b11 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,7 +9,7 @@ Name: libpfm Version: 4.13.0 -Release: 11%{?dist} +Release: 12%{?dist} Summary: Library to encode performance events for use by perf tool @@ -132,6 +132,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Mon Jun 02 2025 Python Maint - 4.13.0-12 +- Rebuilt for Python 3.14 + * Fri Jan 17 2025 Fedora Release Engineering - 4.13.0-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From 12330968afe4d47e389a8242296bb9634058bbef Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 24 Jul 2025 20:10:36 +0000 Subject: [PATCH 89/94] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index d478b11..79bca51 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,7 +9,7 @@ Name: libpfm Version: 4.13.0 -Release: 12%{?dist} +Release: 13%{?dist} Summary: Library to encode performance events for use by perf tool @@ -132,6 +132,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Thu Jul 24 2025 Fedora Release Engineering - 4.13.0-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Mon Jun 02 2025 Python Maint - 4.13.0-12 - Rebuilt for Python 3.14 From 9b4205af69aa73b02e72726991365d5f870048d3 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 15 Aug 2025 12:56:39 +0200 Subject: [PATCH 90/94] Rebuilt for Python 3.14.0rc2 bytecode --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 79bca51..fef78c1 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,7 +9,7 @@ Name: libpfm Version: 4.13.0 -Release: 13%{?dist} +Release: 14%{?dist} Summary: Library to encode performance events for use by perf tool @@ -132,6 +132,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Fri Aug 15 2025 Python Maint - 4.13.0-14 +- Rebuilt for Python 3.14.0rc2 bytecode + * Thu Jul 24 2025 Fedora Release Engineering - 4.13.0-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From 91fced006a95ab85a5c30a572a81f870fc9b0f87 Mon Sep 17 00:00:00 2001 From: Aaron Merey Date: Mon, 25 Aug 2025 11:18:03 -0400 Subject: [PATCH 91/94] tests/runtest.sh: Fix path to tests Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2389127 --- tests/libpfm-testsuite/runtest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/libpfm-testsuite/runtest.sh b/tests/libpfm-testsuite/runtest.sh index 7c8e03d..a5997d6 100755 --- a/tests/libpfm-testsuite/runtest.sh +++ b/tests/libpfm-testsuite/runtest.sh @@ -55,7 +55,7 @@ rlJournalStart rlRun "yum-builddep -y $TmpDir/SPECS/*.spec" rlRun "su -c 'rpmbuild -D \"_topdir $TmpDir\" -bp $TmpDir/SPECS/*.spec &>$TmpDir/rpmbuild.log' $BUILD_USER" rlRun "rlFileSubmit $TmpDir/rpmbuild.log" - rlRun "cd $TmpDir/BUILD/libpfm-*/tests" + rlRun "cd \"$TmpDir\"/BUILD/libpfm-*-build/libpfm-*/tests 2>/dev/null || cd \"$TmpDir\"/BUILD/libpfm-*/tests" rlRun "su -c 'make PFMLIB=`rpm -ql libpfm | grep .so | head -n 1`' $BUILD_USER" rlRun "ldd validate | tee $TmpDir/ldd.log" rlRun "grep -q 'libpfm.so' $TmpDir/ldd.log" From 0bfaf1d1cb79cffd156b0ea7a73095c9eb07d2ff Mon Sep 17 00:00:00 2001 From: Aaron Merey Date: Mon, 25 Aug 2025 12:04:16 -0400 Subject: [PATCH 92/94] libpfm.spec: bump release number --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index fef78c1..409d65b 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,7 +9,7 @@ Name: libpfm Version: 4.13.0 -Release: 14%{?dist} +Release: 15%{?dist} Summary: Library to encode performance events for use by perf tool @@ -132,6 +132,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Mon Aug 25 2025 Aaron Merey - 4.13.0-15 +- Fix path in tests/runtest.sh + * Fri Aug 15 2025 Python Maint - 4.13.0-14 - Rebuilt for Python 3.14.0rc2 bytecode From 37780f084700403189de71ed0f73776008123bf3 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 19 Sep 2025 12:27:20 +0200 Subject: [PATCH 93/94] Rebuilt for Python 3.14.0rc3 bytecode --- libpfm.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpfm.spec b/libpfm.spec index 409d65b..f9fb838 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,7 +9,7 @@ Name: libpfm Version: 4.13.0 -Release: 15%{?dist} +Release: 16%{?dist} Summary: Library to encode performance events for use by perf tool @@ -132,6 +132,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Fri Sep 19 2025 Python Maint - 4.13.0-16 +- Rebuilt for Python 3.14.0rc3 bytecode + * Mon Aug 25 2025 Aaron Merey - 4.13.0-15 - Fix path in tests/runtest.sh From 7581f961126a36779ddff1aa5f81497a2fe1a7f7 Mon Sep 17 00:00:00 2001 From: Aaron Merey Date: Tue, 16 Dec 2025 10:55:52 -0500 Subject: [PATCH 94/94] Add libpfm-fix-const.patch --- libpfm-fix-const.patch | 59 ++++++++++++++++++++++++++++++++++++++++++ libpfm.spec | 7 ++++- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 libpfm-fix-const.patch diff --git a/libpfm-fix-const.patch b/libpfm-fix-const.patch new file mode 100644 index 0000000..b9a2308 --- /dev/null +++ b/libpfm-fix-const.patch @@ -0,0 +1,59 @@ +From ded148888c501c2e9d21c23263d7c09aed4b97d6 Mon Sep 17 00:00:00 2001 +From: Aaron Merey +Date: Fri, 19 Dec 2025 12:33:33 -0500 +Subject: [PATCH] fix discarded const warning on newer gcc + +--- + lib/pfmlib_common.c | 15 +++++++++------ + tests/validate_x86.c | 2 +- + 2 files changed, 10 insertions(+), 7 deletions(-) + +diff --git a/lib/pfmlib_common.c b/lib/pfmlib_common.c +index 44b5de4..59a7cff 100644 +--- a/lib/pfmlib_common.c ++++ b/lib/pfmlib_common.c +@@ -1625,12 +1625,6 @@ pfmlib_parse_event(const char *event, pfmlib_event_desc_t *d) + const char *pname = NULL; + int i, j, ret; + +- /* +- * support only one event at a time. +- */ +- p = strpbrk(event, PFMLIB_EVENT_DELIM); +- if (p) +- return PFM_ERR_INVAL; + /* + * create copy because string is const + */ +@@ -1638,6 +1632,15 @@ pfmlib_parse_event(const char *event, pfmlib_event_desc_t *d) + if (!str) + return PFM_ERR_NOMEM; + ++ /* ++ * support only one event at a time. ++ */ ++ p = strpbrk(s, PFMLIB_EVENT_DELIM); ++ if (p) { ++ free(s); ++ return PFM_ERR_INVAL; ++ } ++ + + /* check for optional PMU name */ + p = strstr(s, PFMLIB_PMU_DELIM); +diff --git a/tests/validate_x86.c b/tests/validate_x86.c +index 500a697..68a776d 100644 +--- a/tests/validate_x86.c ++++ b/tests/validate_x86.c +@@ -8018,7 +8018,7 @@ static int + check_pmu_supported(const char *evt) + { + pfm_pmu_info_t info; +- char *p; ++ const char *p; + int ret; + pfm_pmu_t i; + +-- +2.52.0 + diff --git a/libpfm.spec b/libpfm.spec index f9fb838..d7384ca 100644 --- a/libpfm.spec +++ b/libpfm.spec @@ -9,13 +9,14 @@ Name: libpfm Version: 4.13.0 -Release: 16%{?dist} +Release: 17%{?dist} Summary: Library to encode performance events for use by perf tool License: MIT URL: http://perfmon2.sourceforge.net/ Source0: http://sourceforge.net/projects/perfmon2/files/libpfm4/%{name}-%{version}.tar.gz +Patch1: libpfm-fix-const.patch Patch2: libpfm-python3-setup.patch Patch3: libpfm-gcc14.patch @@ -71,6 +72,7 @@ Python bindings for libpfm4 and perf_event_open system call. %prep %setup -q +%patch -P1 -p1 -b .fix-const %patch -P2 -p1 -b .python3 %patch -P3 -p1 -b .gcc14 # to prevent setuptools from installing an .egg, we need to pass --root to setup.py install @@ -132,6 +134,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/lib*.a %endif %changelog +* Tue Dec 16 2025 Aaron Merey - 4.13.0-17 +- Add libpfm-fix-const.patch + * Fri Sep 19 2025 Python Maint - 4.13.0-16 - Rebuilt for Python 3.14.0rc3 bytecode