Skip to content

Commit 2f09707

Browse files
committed
Add an amdgpu pmda
This pmda retrieves data using the libdrm and libdrm-amdgpu libraries. It only retrieves general information, no process specific data. Data retrieved includes memory usage, memory speed, GPU speed, temperature, etc ... Old Radeon (Pre GCN 1.1) aren't supported. Signed-off-by: Frédéric Bérat <[email protected]>
1 parent bab1ef8 commit 2f09707

30 files changed

+4034
-2082
lines changed

Diff for: aclocal.m4

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
1+
# generated automatically by aclocal 1.16.5 -*- Autoconf -*-
22

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

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

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

1818
dnl Copyright © 2004 Scott James Remnant <[email protected]>.
1919
dnl Copyright © 2012-2015 Dan Nicholson <[email protected]>
@@ -55,7 +55,7 @@ dnl
5555
dnl See the "Since" comment for each macro you use to see what version
5656
dnl of the macros you require.
5757
m4_defun([PKG_PREREQ],
58-
[m4_define([PKG_MACROS_VERSION], [0.29.1])
58+
[m4_define([PKG_MACROS_VERSION], [0.29.2])
5959
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
6060
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
6161
])dnl PKG_PREREQ
@@ -100,7 +100,7 @@ dnl Check to see whether a particular set of modules exists. Similar to
100100
dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
101101
dnl
102102
dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
103-
dnl only at the first occurence in configure.ac, so if the first place
103+
dnl only at the first occurrence in configure.ac, so if the first place
104104
dnl it's called might be skipped (such as if it is within an "if", you
105105
dnl have to call PKG_CHECK_EXISTS manually
106106
AC_DEFUN([PKG_CHECK_EXISTS],
@@ -156,7 +156,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
156156
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
157157
158158
pkg_failed=no
159-
AC_MSG_CHECKING([for $1])
159+
AC_MSG_CHECKING([for $2])
160160
161161
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
162162
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
@@ -166,17 +166,17 @@ and $1[]_LIBS to avoid the need to call pkg-config.
166166
See the pkg-config man page for more details.])
167167
168168
if test $pkg_failed = yes; then
169-
AC_MSG_RESULT([no])
169+
AC_MSG_RESULT([no])
170170
_PKG_SHORT_ERRORS_SUPPORTED
171171
if test $_pkg_short_errors_supported = yes; then
172-
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
173-
else
174-
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
172+
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
173+
else
174+
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
175175
fi
176-
# Put the nasty error message in config.log where it belongs
177-
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
176+
# Put the nasty error message in config.log where it belongs
177+
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
178178
179-
m4_default([$4], [AC_MSG_ERROR(
179+
m4_default([$4], [AC_MSG_ERROR(
180180
[Package requirements ($2) were not met:
181181
182182
$$1_PKG_ERRORS
@@ -187,8 +187,8 @@ installed software in a non-standard prefix.
187187
_PKG_TEXT])[]dnl
188188
])
189189
elif test $pkg_failed = untried; then
190-
AC_MSG_RESULT([no])
191-
m4_default([$4], [AC_MSG_FAILURE(
190+
AC_MSG_RESULT([no])
191+
m4_default([$4], [AC_MSG_FAILURE(
192192
[The pkg-config script could not be found or is too old. Make sure it
193193
is in your PATH or set the PKG_CONFIG environment variable to the full
194194
path to pkg-config.
@@ -198,10 +198,10 @@ _PKG_TEXT
198198
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
199199
])
200200
else
201-
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
202-
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
201+
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
202+
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
203203
AC_MSG_RESULT([yes])
204-
$3
204+
$3
205205
fi[]dnl
206206
])dnl PKG_CHECK_MODULES
207207

Diff for: build/rpm/pcp.spec.in

+31-1
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,9 @@ Requires: pcp-pmda-postfix
402402
%if "@pmda_resctrl@" == "true"
403403
Requires: pcp-pmda-resctrl
404404
%endif
405+
%if "@pmda_amdgpu@" == "true"
406+
Requires: pcp-pmda-amdgpu
407+
%endif
405408
Requires: pcp-system-tools
406409
%if "@enable_qt@" == "true"
407410
Requires: pcp-gui
@@ -2264,6 +2267,23 @@ collecting metrics about web server logs.
22642267
# end pcp-pmda-weblog
22652268
# end C pmdas
22662269

2270+
%if "@pmda_amdgpu@" == "true"
2271+
#
2272+
# pcp-pmda-amdgpu
2273+
#
2274+
%package pmda-amdgpu
2275+
License: GPL-2.0-or-later
2276+
Summary: Performance Co-Pilot (PCP) metrics from AMD GPU devices
2277+
URL: https://pcp.io
2278+
Requires: pcp = @package_version@ pcp-libs = @package_version@
2279+
Requires: libdrm
2280+
BuildRequires: libdrm-devel
2281+
%description pmda-amdgpu
2282+
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
2283+
extracting performance metrics from AMDGPU devices.
2284+
# end pcp-pmda-amdgpu
2285+
%endif
2286+
22672287

22682288
%package zeroconf
22692289
License: GPL-2.0-or-later
@@ -2426,6 +2446,7 @@ basic_manifest | keep 'pcp2xml' >pcp-export-pcp2xml-files
24262446
basic_manifest | keep 'pcp2zabbix' >pcp-export-pcp2zabbix-files
24272447
basic_manifest | keep 'zabbix|zbxpcp' | cull pcp2zabbix >pcp-export-zabbix-agent-files
24282448
basic_manifest | keep '(etc/pcp|pmdas)/activemq(/|$)' >pcp-pmda-activemq-files
2449+
basic_manifest | keep '(etc/pcp|pmdas)/amdgpu(/|$)' >pcp-pmda-amdgpu-files
24292450
basic_manifest | keep '(etc/pcp|pmdas)/apache(/|$)' >pcp-pmda-apache-files
24302451
basic_manifest | keep '(etc/pcp|pmdas)/bash(/|$)' >pcp-pmda-bash-files
24312452
basic_manifest | keep '(etc/pcp|pmdas)/bcc(/|$)' >pcp-pmda-bcc-files
@@ -2504,7 +2525,7 @@ basic_manifest | keep '(etc/pcp|pmdas)/zswap(/|$)' >pcp-pmda-zswap-files
25042525

25052526
rm -f packages.list
25062527
for pmda_package in \
2507-
activemq apache \
2528+
activemq amdgpu apache \
25082529
bash bcc bind2 bonding bpf bpftrace \
25092530
cifs cisco \
25102531
dbping denki docker dm ds389 ds389log \
@@ -2942,6 +2963,11 @@ done
29422963
%preun pmda-apache
29432964
%{pmda_remove "$1" "apache"}
29442965

2966+
%if "@pmda_amdgpu@" == "true"
2967+
%preun pmda-amdgpu
2968+
%{pmda_remove "$1" "amdgpu"}
2969+
%endif
2970+
29452971
%preun pmda-bash
29462972
%{pmda_remove "$1" "bash"}
29472973

@@ -3302,6 +3328,10 @@ fi
33023328

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

3331+
%if "@pmda_amdgpu@" == "true"
3332+
%files pmda-amdgpu -f pcp-pmda-amdgpu-files.rpm
3333+
%endif
3334+
33053335
%files pmda-bash -f pcp-pmda-bash-files.rpm
33063336

33073337
%files pmda-cifs -f pcp-pmda-cifs-files.rpm

Diff for: build/rpm/redhat.spec

+37-1
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,12 @@ ExcludeArch: %{ix86}
216216
%global disable_xlsx 1
217217
%endif
218218

219+
%if 0%{?fedora} >= 40 || 0%{?rhel} >= 10
220+
%global disable_amdgpu 0
221+
%else
222+
%global disable_amdgpu 1
223+
%endif
224+
219225
# prevent conflicting binary and man page install for pcp(1)
220226
Conflicts: librapi < 0.16
221227

@@ -591,6 +597,9 @@ Requires: pcp-pmda-json
591597
Requires: pcp-pmda-resctrl
592598
%endif
593599
Requires: pcp-pmda-summary pcp-pmda-trace pcp-pmda-weblog
600+
%if !%{disable_amdgpu}
601+
Requires: pcp-pmda-amdgpu
602+
%endif
594603
Requires: pcp-system-tools
595604
%if !%{disable_qt}
596605
Requires: pcp-gui
@@ -2269,6 +2278,23 @@ collecting metrics about web server logs.
22692278
# end pcp-pmda-weblog
22702279
# end C pmdas
22712280

2281+
%if !%{disable_amdgpu}
2282+
#
2283+
# pcp-pmda-amdgpu
2284+
#
2285+
%package pmda-amdgpu
2286+
License: GPL-2.0-or-later
2287+
Summary: Performance Co-Pilot (PCP) metrics from AMD GPU devices
2288+
URL: https://pcp.io
2289+
Requires: pcp = @package_version@ pcp-libs = @package_version@
2290+
Requires: libdrm
2291+
BuildRequires: libdrm-devel
2292+
%description pmda-amdgpu
2293+
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
2294+
extracting performance metrics from AMDGPU devices.
2295+
# end pcp-pmda-amdgpu
2296+
%endif
2297+
22722298
%package zeroconf
22732299
License: GPL-2.0-or-later
22742300
Summary: Performance Co-Pilot (PCP) Zeroconf Package
@@ -2598,6 +2624,7 @@ basic_manifest | keep 'pcp2xml' >pcp-export-pcp2xml-files
25982624
basic_manifest | keep 'pcp2zabbix' >pcp-export-pcp2zabbix-files
25992625
basic_manifest | keep 'zabbix|zbxpcp' | cull pcp2zabbix >pcp-export-zabbix-agent-files
26002626
basic_manifest | keep '(etc/pcp|pmdas)/activemq(/|$)' >pcp-pmda-activemq-files
2627+
basic_manifest | keep '(etc/pcp|pmdas)/amdgpu(/|$)' >pcp-pmda-amdgpu-files
26012628
basic_manifest | keep '(etc/pcp|pmdas)/apache(/|$)' >pcp-pmda-apache-files
26022629
basic_manifest | keep '(etc/pcp|pmdas)/bash(/|$)' >pcp-pmda-bash-files
26032630
basic_manifest | keep '(etc/pcp|pmdas)/bcc(/|$)' >pcp-pmda-bcc-files
@@ -2677,7 +2704,7 @@ basic_manifest | keep '(etc/pcp|pmdas)/zswap(/|$)' >pcp-pmda-zswap-files
26772704

26782705
rm -f packages.list
26792706
for pmda_package in \
2680-
activemq apache \
2707+
activemq amdgpu apache \
26812708
bash bcc bind2 bonding bpf bpftrace \
26822709
cifs cisco \
26832710
dbping denki docker dm ds389 ds389log \
@@ -3130,6 +3157,11 @@ exit 0
31303157
%preun pmda-weblog
31313158
%{pmda_remove "$1" "weblog"}
31323159

3160+
%if !%{disable_amdgpu}
3161+
%preun pmda-amdgpu
3162+
%{pmda_remove "$1" "amdgpu"}
3163+
%endif
3164+
31333165
%preun
31343166
if [ "$1" -eq 0 ]
31353167
then
@@ -3448,6 +3480,10 @@ fi
34483480
%files pmda-openmetrics -f pcp-pmda-openmetrics-files.rpm
34493481
%endif
34503482

3483+
%if !%{disable_amdgpu}
3484+
%files pmda-amdgpu -f pcp-pmda-amdgpu-files.rpm
3485+
%endif
3486+
34513487
%files pmda-apache -f pcp-pmda-apache-files.rpm
34523488

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

0 commit comments

Comments
 (0)