#! /bin/sh
#
# Copyright (c) 2014 Red Hat.
# 
# 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.
# 
# Install the PAPI PMDA and/or PMNS
#

. $PCP_DIR/etc/pcp.env
. $PCP_SHARE_DIR/lib/pmdaproc.sh

iam=papi
pmda_interface=6

pmdaSetup
# NB: Some number of warnings from the "pmprobe -i papi" embedded
# within pmdaInstall is expected.  Not all papi counters can possibly
# be activated at the same time, even with multiplexing: the excess will
# come back with PM_ERR_VALUE.
pmdaInstall
# Shut down any counters auto-enabled during the pmdaInstall step
pmstore papi.control.reset "" >/dev/null
echo "Note: Some warnings are expected as the number of available hardware Metrics"
echo "may exceed the maximum concurrently countable metrics."
exit
