Skip to content

Commit

Permalink
Merge branch 'devel/amdgpu' of https://github.com/fberat/pcp into fbe…
Browse files Browse the repository at this point in the history
…rat-devel/amdgpu
  • Loading branch information
natoscott committed Jul 4, 2024
2 parents 9d11c6b + 2f09707 commit e92fe2e
Show file tree
Hide file tree
Showing 30 changed files with 4,034 additions and 2,082 deletions.
38 changes: 19 additions & 19 deletions aclocal.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
# generated automatically by aclocal 1.16.5 -*- Autoconf -*-

# Copyright (C) 1996-2017 Free Software Foundation, Inc.
# Copyright (C) 1996-2021 Free Software Foundation, Inc.

# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand All @@ -12,8 +12,8 @@
# PARTICULAR PURPOSE.

m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# serial 11 (pkg-config-0.29.1)
# pkg.m4 - Macros to locate and use pkg-config. -*- Autoconf -*-
# serial 12 (pkg-config-0.29.2)

dnl Copyright © 2004 Scott James Remnant <[email protected]>.
dnl Copyright © 2012-2015 Dan Nicholson <[email protected]>
Expand Down Expand Up @@ -55,7 +55,7 @@ dnl
dnl See the "Since" comment for each macro you use to see what version
dnl of the macros you require.
m4_defun([PKG_PREREQ],
[m4_define([PKG_MACROS_VERSION], [0.29.1])
[m4_define([PKG_MACROS_VERSION], [0.29.2])
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
])dnl PKG_PREREQ
Expand Down Expand Up @@ -100,7 +100,7 @@ dnl Check to see whether a particular set of modules exists. Similar to
dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
dnl
dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
dnl only at the first occurence in configure.ac, so if the first place
dnl only at the first occurrence in configure.ac, so if the first place
dnl it's called might be skipped (such as if it is within an "if", you
dnl have to call PKG_CHECK_EXISTS manually
AC_DEFUN([PKG_CHECK_EXISTS],
Expand Down Expand Up @@ -156,7 +156,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $1])
AC_MSG_CHECKING([for $2])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
Expand All @@ -166,17 +166,17 @@ and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
m4_default([$4], [AC_MSG_ERROR(
m4_default([$4], [AC_MSG_ERROR(
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
Expand All @@ -187,8 +187,8 @@ installed software in a non-standard prefix.
_PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
Expand All @@ -198,10 +198,10 @@ _PKG_TEXT
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
$3
$3
fi[]dnl
])dnl PKG_CHECK_MODULES

Expand Down
32 changes: 31 additions & 1 deletion build/rpm/pcp.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,9 @@ Requires: pcp-pmda-postfix
%if "@pmda_resctrl@" == "true"
Requires: pcp-pmda-resctrl
%endif
%if "@pmda_amdgpu@" == "true"
Requires: pcp-pmda-amdgpu
%endif
Requires: pcp-system-tools
%if "@enable_qt@" == "true"
Requires: pcp-gui
Expand Down Expand Up @@ -2264,6 +2267,23 @@ collecting metrics about web server logs.
# end pcp-pmda-weblog
# end C pmdas

%if "@pmda_amdgpu@" == "true"
#
# pcp-pmda-amdgpu
#
%package pmda-amdgpu
License: GPL-2.0-or-later
Summary: Performance Co-Pilot (PCP) metrics from AMD GPU devices
URL: https://pcp.io
Requires: pcp = @package_version@ pcp-libs = @package_version@
Requires: libdrm
BuildRequires: libdrm-devel
%description pmda-amdgpu
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
extracting performance metrics from AMDGPU devices.
# end pcp-pmda-amdgpu
%endif


%package zeroconf
License: GPL-2.0-or-later
Expand Down Expand Up @@ -2426,6 +2446,7 @@ basic_manifest | keep 'pcp2xml' >pcp-export-pcp2xml-files
basic_manifest | keep 'pcp2zabbix' >pcp-export-pcp2zabbix-files
basic_manifest | keep 'zabbix|zbxpcp' | cull pcp2zabbix >pcp-export-zabbix-agent-files
basic_manifest | keep '(etc/pcp|pmdas)/activemq(/|$)' >pcp-pmda-activemq-files
basic_manifest | keep '(etc/pcp|pmdas)/amdgpu(/|$)' >pcp-pmda-amdgpu-files
basic_manifest | keep '(etc/pcp|pmdas)/apache(/|$)' >pcp-pmda-apache-files
basic_manifest | keep '(etc/pcp|pmdas)/bash(/|$)' >pcp-pmda-bash-files
basic_manifest | keep '(etc/pcp|pmdas)/bcc(/|$)' >pcp-pmda-bcc-files
Expand Down Expand Up @@ -2504,7 +2525,7 @@ basic_manifest | keep '(etc/pcp|pmdas)/zswap(/|$)' >pcp-pmda-zswap-files

rm -f packages.list
for pmda_package in \
activemq apache \
activemq amdgpu apache \
bash bcc bind2 bonding bpf bpftrace \
cifs cisco \
dbping denki docker dm ds389 ds389log \
Expand Down Expand Up @@ -2942,6 +2963,11 @@ done
%preun pmda-apache
%{pmda_remove "$1" "apache"}

%if "@pmda_amdgpu@" == "true"
%preun pmda-amdgpu
%{pmda_remove "$1" "amdgpu"}
%endif

%preun pmda-bash
%{pmda_remove "$1" "bash"}

Expand Down Expand Up @@ -3302,6 +3328,10 @@ fi

%files pmda-apache -f pcp-pmda-apache-files.rpm

%if "@pmda_amdgpu@" == "true"
%files pmda-amdgpu -f pcp-pmda-amdgpu-files.rpm
%endif

%files pmda-bash -f pcp-pmda-bash-files.rpm

%files pmda-cifs -f pcp-pmda-cifs-files.rpm
Expand Down
38 changes: 37 additions & 1 deletion build/rpm/redhat.spec
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ ExcludeArch: %{ix86}
%global disable_xlsx 1
%endif

%if 0%{?fedora} >= 40 || 0%{?rhel} >= 10
%global disable_amdgpu 0
%else
%global disable_amdgpu 1
%endif

# prevent conflicting binary and man page install for pcp(1)
Conflicts: librapi < 0.16

Expand Down Expand Up @@ -591,6 +597,9 @@ Requires: pcp-pmda-json
Requires: pcp-pmda-resctrl
%endif
Requires: pcp-pmda-summary pcp-pmda-trace pcp-pmda-weblog
%if !%{disable_amdgpu}
Requires: pcp-pmda-amdgpu
%endif
Requires: pcp-system-tools
%if !%{disable_qt}
Requires: pcp-gui
Expand Down Expand Up @@ -2269,6 +2278,23 @@ collecting metrics about web server logs.
# end pcp-pmda-weblog
# end C pmdas

%if !%{disable_amdgpu}
#
# pcp-pmda-amdgpu
#
%package pmda-amdgpu
License: GPL-2.0-or-later
Summary: Performance Co-Pilot (PCP) metrics from AMD GPU devices
URL: https://pcp.io
Requires: pcp = @package_version@ pcp-libs = @package_version@
Requires: libdrm
BuildRequires: libdrm-devel
%description pmda-amdgpu
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
extracting performance metrics from AMDGPU devices.
# end pcp-pmda-amdgpu
%endif

%package zeroconf
License: GPL-2.0-or-later
Summary: Performance Co-Pilot (PCP) Zeroconf Package
Expand Down Expand Up @@ -2598,6 +2624,7 @@ basic_manifest | keep 'pcp2xml' >pcp-export-pcp2xml-files
basic_manifest | keep 'pcp2zabbix' >pcp-export-pcp2zabbix-files
basic_manifest | keep 'zabbix|zbxpcp' | cull pcp2zabbix >pcp-export-zabbix-agent-files
basic_manifest | keep '(etc/pcp|pmdas)/activemq(/|$)' >pcp-pmda-activemq-files
basic_manifest | keep '(etc/pcp|pmdas)/amdgpu(/|$)' >pcp-pmda-amdgpu-files
basic_manifest | keep '(etc/pcp|pmdas)/apache(/|$)' >pcp-pmda-apache-files
basic_manifest | keep '(etc/pcp|pmdas)/bash(/|$)' >pcp-pmda-bash-files
basic_manifest | keep '(etc/pcp|pmdas)/bcc(/|$)' >pcp-pmda-bcc-files
Expand Down Expand Up @@ -2677,7 +2704,7 @@ basic_manifest | keep '(etc/pcp|pmdas)/zswap(/|$)' >pcp-pmda-zswap-files

rm -f packages.list
for pmda_package in \
activemq apache \
activemq amdgpu apache \
bash bcc bind2 bonding bpf bpftrace \
cifs cisco \
dbping denki docker dm ds389 ds389log \
Expand Down Expand Up @@ -3130,6 +3157,11 @@ exit 0
%preun pmda-weblog
%{pmda_remove "$1" "weblog"}

%if !%{disable_amdgpu}
%preun pmda-amdgpu
%{pmda_remove "$1" "amdgpu"}
%endif

%preun
if [ "$1" -eq 0 ]
then
Expand Down Expand Up @@ -3448,6 +3480,10 @@ fi
%files pmda-openmetrics -f pcp-pmda-openmetrics-files.rpm
%endif

%if !%{disable_amdgpu}
%files pmda-amdgpu -f pcp-pmda-amdgpu-files.rpm
%endif

%files pmda-apache -f pcp-pmda-apache-files.rpm

%files pmda-bash -f pcp-pmda-bash-files.rpm
Expand Down
Loading

0 comments on commit e92fe2e

Please sign in to comment.