Blob Blame History Raw
commit 56ebe5fde238569be2c8b5b4babc9430eedb3616
Author: Nathan Scott <nathans@redhat.com>
Date:   Tue Feb 11 10:48:14 2014 +1100

    Changes to pmdasample to support multlib devel packages
    
    This removes architecture-dependent files in the development
    package related to pmdasample.  Instead of installing prebuilt
    binaries, we now use the pmdasimple/pmdatrivial technique of
    installing a makefile and generating them.
    
    There's a bit of code tweaking in terms of header includes and
    domain number file generation, making pmdasample code match up
    more closely now with the other devel PMDAs.

diff --git a/qa/156 b/qa/156
index 4b2347a..319b2cc 100755
--- a/qa/156
+++ b/qa/156
@@ -17,8 +17,11 @@ rm -f $seq.out
 if [ $PCP_VER -lt 3600 ]
 then
     ln $seq.out.1 $seq.out || exit 1
-else
+elif [ $PCP_VER -lt 3810 ]
+then
     ln $seq.out.2 $seq.out || exit 1
+else
+    ln $seq.out.3 $seq.out || exit 1
 fi
 
 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
diff --git a/qa/156.out.3 b/qa/156.out.3
new file mode 100644
index 0000000..f5c0d86
--- /dev/null
+++ b/qa/156.out.3
@@ -0,0 +1,329 @@
+QA output created by 156
+Waiting for pmcd to terminate ...
+Starting pmcd ... 
+Starting pmlogger ... 
+
+=== remove agent ===
+Culling the Performance Metrics Name Space ...
+sample ... done
+Updating the PMCD control file, and notifying PMCD ...
+Removing files ...
+Check sample metrics have gone away ... OK
+Culling the Performance Metrics Name Space ...
+sampledso ... done
+Updating the PMCD control file, and notifying PMCD ...
+Removing files ...
+Check sampledso metrics have gone away ... OK
+Error: sample: Unknown metric name
+
+=== pipe agent ===
+You will need to choose an appropriate configuration for installation of
+the "sample" Performance Metrics Domain Agent (PMDA).
+
+  collector	collect performance statistics on this system
+  monitor	allow this system to monitor local and/or remote systems
+  both		collector and monitor configuration for this system
+
+Please enter c(ollector) or m(onitor) or b(oth) [b] both
+======================
+= sample daemon PMDA =
+======================
+PMCD should communicate with the sample daemon via a pipe or a socket? [pipe] pipe
+Installing files ...
+[...install files, make output...]
+Updating the Performance Metrics Name Space (PMNS) ...
+Terminate PMDA if already installed ...
+[...install files, make output...]
+Updating the PMCD control file, and notifying PMCD ...
+Check sample metrics have appeared ... 10+ warnings, 100+ metrics and 1200+ values
+======================
+= sampledso DSO PMDA =
+======================
+Installing files ...
+[...install files, make output...]
+Updating the Performance Metrics Name Space (PMNS) ...
+Terminate PMDA if already installed ...
+[...install files, make output...]
+Updating the PMCD control file, and notifying PMCD ...
+Check sampledso metrics have appeared ... 10+ warnings, 100+ metrics and 1200+ values
+sample.darkness: No value(s) available
+sample.noinst: No value(s) available
+sample.needprofile: Explicit instance identifier(s) required
+sample.bad.unknown: pmLookupDesc: Unknown or illegal metric identifier
+sample.bad.nosupport: Not Supported
+sample.event.type: No value(s) available
+sample.event.param_32: No value(s) available
+sample.event.param_u32: No value(s) available
+sample.event.param_64: No value(s) available
+sample.event.param_u64: No value(s) available
+sample.event.param_float: No value(s) available
+sample.event.param_double: No value(s) available
+sample.event.param_string: No value(s) available
+sample.event.param_aggregate: No value(s) available
+You will need to choose an appropriate configuration for installation of
+the "sample" Performance Metrics Domain Agent (PMDA).
+
+  collector	collect performance statistics on this system
+  monitor	allow this system to monitor local and/or remote systems
+  both		collector and monitor configuration for this system
+
+Please enter c(ollector) or m(onitor) or b(oth) [b] both
+======================
+= sample daemon PMDA =
+======================
+PMCD should communicate with the sample daemon via a pipe or a socket? [pipe] pipe
+Installing files ...
+[...install files, make output...]
+Updating the Performance Metrics Name Space (PMNS) ...
+Terminate PMDA if already installed ...
+[...install files, make output...]
+Updating the PMCD control file, and notifying PMCD ...
+Check sample metrics have appeared ... 10+ warnings, 100+ metrics and 1200+ values
+======================
+= sampledso DSO PMDA =
+======================
+Installing files ...
+[...install files, make output...]
+Updating the Performance Metrics Name Space (PMNS) ...
+Terminate PMDA if already installed ...
+[...install files, make output...]
+Updating the PMCD control file, and notifying PMCD ...
+Check sampledso metrics have appeared ... 10+ warnings, 100+ metrics and 1200+ values
+sample.darkness: No value(s) available
+sample.noinst: No value(s) available
+sample.needprofile: Explicit instance identifier(s) required
+sample.bad.unknown: pmLookupDesc: Unknown or illegal metric identifier
+sample.bad.nosupport: Not Supported
+sample.event.type: No value(s) available
+sample.event.param_32: No value(s) available
+sample.event.param_u32: No value(s) available
+sample.event.param_64: No value(s) available
+sample.event.param_u64: No value(s) available
+sample.event.param_float: No value(s) available
+sample.event.param_double: No value(s) available
+sample.event.param_string: No value(s) available
+sample.event.param_aggregate: No value(s) available
+
+=== socket Internet agent ===
+You will need to choose an appropriate configuration for installation of
+the "sample" Performance Metrics Domain Agent (PMDA).
+
+  collector	collect performance statistics on this system
+  monitor	allow this system to monitor local and/or remote systems
+  both		collector and monitor configuration for this system
+
+Please enter c(ollector) or m(onitor) or b(oth) [b] both
+======================
+= sample daemon PMDA =
+======================
+PMCD should communicate with the sample daemon via a pipe or a socket? [pipe] socket
+Use Internet, IPv6 or Unix domain sockets? [Internet] Internet
+Internet port number or service name? [2077] PORT1
+Installing files ...
+[...install files, make output...]
+Updating the Performance Metrics Name Space (PMNS) ...
+Terminate PMDA if already installed ...
+[...install files, make output...]
+Updating the PMCD control file, and notifying PMCD ...
+Check sample metrics have appeared ... 10+ warnings, 100+ metrics and 1200+ values
+======================
+= sampledso DSO PMDA =
+======================
+Installing files ...
+[...install files, make output...]
+Updating the Performance Metrics Name Space (PMNS) ...
+Terminate PMDA if already installed ...
+[...install files, make output...]
+Updating the PMCD control file, and notifying PMCD ...
+Check sampledso metrics have appeared ... 10+ warnings, 100+ metrics and 1200+ values
+sample.darkness: No value(s) available
+sample.noinst: No value(s) available
+sample.needprofile: Explicit instance identifier(s) required
+sample.bad.unknown: pmLookupDesc: Unknown or illegal metric identifier
+sample.bad.nosupport: Not Supported
+sample.event.type: No value(s) available
+sample.event.param_32: No value(s) available
+sample.event.param_u32: No value(s) available
+sample.event.param_64: No value(s) available
+sample.event.param_u64: No value(s) available
+sample.event.param_float: No value(s) available
+sample.event.param_double: No value(s) available
+sample.event.param_string: No value(s) available
+sample.event.param_aggregate: No value(s) available
+You will need to choose an appropriate configuration for installation of
+the "sample" Performance Metrics Domain Agent (PMDA).
+
+  collector	collect performance statistics on this system
+  monitor	allow this system to monitor local and/or remote systems
+  both		collector and monitor configuration for this system
+
+Please enter c(ollector) or m(onitor) or b(oth) [b] both
+======================
+= sample daemon PMDA =
+======================
+PMCD should communicate with the sample daemon via a pipe or a socket? [pipe] socket
+Use Internet, IPv6 or Unix domain sockets? [Internet] Internet
+Internet port number or service name? [2077] PORT2
+Installing files ...
+[...install files, make output...]
+Updating the Performance Metrics Name Space (PMNS) ...
+Terminate PMDA if already installed ...
+[...install files, make output...]
+Updating the PMCD control file, and notifying PMCD ...
+Check sample metrics have appeared ... 10+ warnings, 100+ metrics and 1200+ values
+======================
+= sampledso DSO PMDA =
+======================
+Installing files ...
+[...install files, make output...]
+Updating the Performance Metrics Name Space (PMNS) ...
+Terminate PMDA if already installed ...
+[...install files, make output...]
+Updating the PMCD control file, and notifying PMCD ...
+Check sampledso metrics have appeared ... 10+ warnings, 100+ metrics and 1200+ values
+sample.darkness: No value(s) available
+sample.noinst: No value(s) available
+sample.needprofile: Explicit instance identifier(s) required
+sample.bad.unknown: pmLookupDesc: Unknown or illegal metric identifier
+sample.bad.nosupport: Not Supported
+sample.event.type: No value(s) available
+sample.event.param_32: No value(s) available
+sample.event.param_u32: No value(s) available
+sample.event.param_64: No value(s) available
+sample.event.param_u64: No value(s) available
+sample.event.param_float: No value(s) available
+sample.event.param_double: No value(s) available
+sample.event.param_string: No value(s) available
+sample.event.param_aggregate: No value(s) available
+
+=== socket Unix agent ===
+You will need to choose an appropriate configuration for installation of
+the "sample" Performance Metrics Domain Agent (PMDA).
+
+  collector	collect performance statistics on this system
+  monitor	allow this system to monitor local and/or remote systems
+  both		collector and monitor configuration for this system
+
+Please enter c(ollector) or m(onitor) or b(oth) [b] both
+======================
+= sample daemon PMDA =
+======================
+PMCD should communicate with the sample daemon via a pipe or a socket? [pipe] socket
+Use Internet, IPv6 or Unix domain sockets? [Internet] Unix
+Unix FIFO name? TMP.fifo
+Installing files ...
+[...install files, make output...]
+Updating the Performance Metrics Name Space (PMNS) ...
+Terminate PMDA if already installed ...
+[...install files, make output...]
+Updating the PMCD control file, and notifying PMCD ...
+Check sample metrics have appeared ... 10+ warnings, 100+ metrics and 1200+ values
+======================
+= sampledso DSO PMDA =
+======================
+Installing files ...
+[...install files, make output...]
+Updating the Performance Metrics Name Space (PMNS) ...
+Terminate PMDA if already installed ...
+[...install files, make output...]
+Updating the PMCD control file, and notifying PMCD ...
+Check sampledso metrics have appeared ... 10+ warnings, 100+ metrics and 1200+ values
+sample.darkness: No value(s) available
+sample.noinst: No value(s) available
+sample.needprofile: Explicit instance identifier(s) required
+sample.bad.unknown: pmLookupDesc: Unknown or illegal metric identifier
+sample.bad.nosupport: Not Supported
+sample.event.type: No value(s) available
+sample.event.param_32: No value(s) available
+sample.event.param_u32: No value(s) available
+sample.event.param_64: No value(s) available
+sample.event.param_u64: No value(s) available
+sample.event.param_float: No value(s) available
+sample.event.param_double: No value(s) available
+sample.event.param_string: No value(s) available
+sample.event.param_aggregate: No value(s) available
+You will need to choose an appropriate configuration for installation of
+the "sample" Performance Metrics Domain Agent (PMDA).
+
+  collector	collect performance statistics on this system
+  monitor	allow this system to monitor local and/or remote systems
+  both		collector and monitor configuration for this system
+
+Please enter c(ollector) or m(onitor) or b(oth) [b] both
+======================
+= sample daemon PMDA =
+======================
+PMCD should communicate with the sample daemon via a pipe or a socket? [pipe] socket
+Use Internet, IPv6 or Unix domain sockets? [Internet] Unix
+Unix FIFO name? TMP.fifo
+Installing files ...
+[...install files, make output...]
+Updating the Performance Metrics Name Space (PMNS) ...
+Terminate PMDA if already installed ...
+[...install files, make output...]
+Updating the PMCD control file, and notifying PMCD ...
+Check sample metrics have appeared ... 10+ warnings, 100+ metrics and 1200+ values
+======================
+= sampledso DSO PMDA =
+======================
+Installing files ...
+[...install files, make output...]
+Updating the Performance Metrics Name Space (PMNS) ...
+Terminate PMDA if already installed ...
+[...install files, make output...]
+Updating the PMCD control file, and notifying PMCD ...
+Check sampledso metrics have appeared ... 10+ warnings, 100+ metrics and 1200+ values
+sample.darkness: No value(s) available
+sample.noinst: No value(s) available
+sample.needprofile: Explicit instance identifier(s) required
+sample.bad.unknown: pmLookupDesc: Unknown or illegal metric identifier
+sample.bad.nosupport: Not Supported
+sample.event.type: No value(s) available
+sample.event.param_32: No value(s) available
+sample.event.param_u32: No value(s) available
+sample.event.param_64: No value(s) available
+sample.event.param_u64: No value(s) available
+sample.event.param_float: No value(s) available
+sample.event.param_double: No value(s) available
+sample.event.param_string: No value(s) available
+sample.event.param_aggregate: No value(s) available
+Culling the Performance Metrics Name Space ...
+sample ... done
+Updating the PMCD control file, and notifying PMCD ...
+Removing files ...
+Check sample metrics have gone away ... OK
+Culling the Performance Metrics Name Space ...
+sampledso ... done
+Updating the PMCD control file, and notifying PMCD ...
+Removing files ...
+Check sampledso metrics have gone away ... OK
+Error: sample: Unknown metric name
+
+Reinstall PMDA ...
+You will need to choose an appropriate configuration for installation of
+the "sample" Performance Metrics Domain Agent (PMDA).
+
+  collector	collect performance statistics on this system
+  monitor	allow this system to monitor local and/or remote systems
+  both		collector and monitor configuration for this system
+
+Please enter c(ollector) or m(onitor) or b(oth) [b] ======================
+= sample daemon PMDA =
+======================
+Installing files ...
+[...install files, make output...]
+Updating the Performance Metrics Name Space (PMNS) ...
+Terminate PMDA if already installed ...
+[...install files, make output...]
+Updating the PMCD control file, and notifying PMCD ...
+Check sample metrics have appeared ... 10+ warnings, 100+ metrics and 1200+ values
+======================
+= sampledso DSO PMDA =
+======================
+Installing files ...
+[...install files, make output...]
+Updating the Performance Metrics Name Space (PMNS) ...
+Terminate PMDA if already installed ...
+[...install files, make output...]
+Updating the PMCD control file, and notifying PMCD ...
+Check sampledso metrics have appeared ... 10+ warnings, 100+ metrics and 1200+ values
diff --git a/qa/642 b/qa/642
index 4b36936..0242503 100755
--- a/qa/642
+++ b/qa/642
@@ -14,7 +14,10 @@ echo "QA output created by $seq"
 . ./common.check
 
 rm -f $seq.out $seq.full
-if [ $PCP_VER -ge 3801 ]
+if [ $PCP_VER -ge 3810 ]
+then
+    ln $seq.out.4 $seq.out || exit 1
+elif [ $PCP_VER -ge 3801 ]
 then
     ln $seq.out.3 $seq.out || exit 1
 elif [ $PCP_VER -ge 3600 ]
diff --git a/qa/642.out.4 b/qa/642.out.4
new file mode 100644
index 0000000..c379768
--- /dev/null
+++ b/qa/642.out.4
@@ -0,0 +1,95 @@
+QA output created by 642
+
+=== install #1 ===
+You will need to choose an appropriate configuration for installation of
+the "trivial" Performance Metrics Domain Agent (PMDA).
+
+  collector	collect performance statistics on this system
+  monitor	allow this system to monitor local and/or remote systems
+  both		collector and monitor configuration for this system
+
+Please enter c(ollector) or m(onitor) or b(oth) [b] 
+Installing files ...
+[...install files, make output...]
+Updating the Performance Metrics Name Space (PMNS) ...
+Terminate PMDA if already installed ...
+[...install files, make output...]
+Updating the PMCD control file, and notifying PMCD ...
+
+=== install #2 ===
+You will need to choose an appropriate configuration for installation of
+the "simple" Performance Metrics Domain Agent (PMDA).
+
+  collector	collect performance statistics on this system
+  monitor	allow this system to monitor local and/or remote systems
+  both		collector and monitor configuration for this system
+
+Please enter c(ollector) or m(onitor) or b(oth) [b] 
+Install simple as a daemon or python or perl or dso agent? [daemon] 
+PMCD should communicate with the simple daemon via a pipe or a socket? [pipe] 
+Installing files ...
+[...install files, make output...]
+Updating the Performance Metrics Name Space (PMNS) ...
+Terminate PMDA if already installed ...
+[...install files, make output...]
+Updating the PMCD control file, and notifying PMCD ...
+
+=== install #3 ===
+You will need to choose an appropriate configuration for installation of
+the "sample" Performance Metrics Domain Agent (PMDA).
+
+  collector	collect performance statistics on this system
+  monitor	allow this system to monitor local and/or remote systems
+  both		collector and monitor configuration for this system
+
+Please enter c(ollector) or m(onitor) or b(oth) [b] 
+======================
+= sample daemon PMDA =
+======================
+PMCD should communicate with the sample daemon via a pipe or a socket? [pipe] 
+Installing files ...
+[...install files, make output...]
+Updating the Performance Metrics Name Space (PMNS) ...
+Terminate PMDA if already installed ...
+[...install files, make output...]
+Updating the PMCD control file, and notifying PMCD ...
+======================
+= sampledso DSO PMDA =
+======================
+Installing files ...
+[...install files, make output...]
+Updating the Performance Metrics Name Space (PMNS) ...
+Terminate PMDA if already installed ...
+[...install files, make output...]
+Updating the PMCD control file, and notifying PMCD ...
+
+=== install #4 ===
+You will need to choose an appropriate configuration for installation of
+the "sendmail" Performance Metrics Domain Agent (PMDA).
+
+  collector	collect performance statistics on this system
+  monitor	allow this system to monitor local and/or remote systems
+  both		collector and monitor configuration for this system
+
+Please enter c(ollector) or m(onitor) or b(oth) [b] 
+Updating the Performance Metrics Name Space (PMNS) ...
+Terminate PMDA if already installed ...
+[...install files, make output...]
+Updating the PMCD control file, and notifying PMCD ...
+
+=== install #5 ===
+Installing the "trace" Performance Metrics Domain Agent (PMDA) ...
+
+Use the default installation [y]? 
+Updating the Performance Metrics Name Space (PMNS) ...
+Terminate PMDA if already installed ...
+[...install files, make output...]
+Updating the PMCD control file, and notifying PMCD ...
+Note: some warnings are expected until trace API calls are made - refer to
+      the man pages for pmtrace(1) and pmdatrace(3) for further details.
+
+=== PMNS differences (none expected) ===
+
+Waiting for pmcd to terminate ...
+Starting pmcd ... 
+Starting pmlogger ... 
diff --git a/src/pmdas/sample/GNUmakefile b/src/pmdas/sample/GNUmakefile
index 778042d..6650ac5 100644
--- a/src/pmdas/sample/GNUmakefile
+++ b/src/pmdas/sample/GNUmakefile
@@ -1,39 +1,29 @@
 #
+# Copyright (c) 2014 Red Hat.  All Rights Reserved.
 # Copyright (c) 2000,2004 Silicon Graphics, Inc.  All Rights Reserved.
-# 
+#
 # 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, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#*************************************************************************
-#
-# Makefile - sample PMDA
 #
-#*************************************************************************
 
 TOPDIR = ../../..
 include $(TOPDIR)/src/include/builddefs
 
-DOMAIN  = SAMPLE
-
 DFILES	= README help
 LSRCFILES = root pmns $(DFILES) Install Remove Sample.pmchart
-LDIRT = domain.h *.dir *.pag sample.log
+LDIRT = *.dir *.pag
 
 SUBDIRS = src
 PMDADIR = $(PCP_PMDAS_DIR)/sample
 
-default_pcp default :: domain.h $(SUBDIRS)
+default_pcp default :: $(SUBDIRS)
 
 default_pcp default :: $(SUBDIRS)
 	$(SUBDIRS_MAKERULE)
@@ -44,13 +34,7 @@ install_pcp install :: $(SUBDIRS)
 install_pcp install :: default
 	$(INSTALL) -d $(PMDADIR)
 	$(INSTALL) -m 755 Install Remove $(PMDADIR)
-	$(INSTALL) -m 644 $(DFILES) pmns root domain.h $(PMDADIR)
+	$(INSTALL) -m 644 $(DFILES) pmns root $(PMDADIR)
 	$(INSTALL) -m 644 Sample.pmchart $(PCP_VAR_DIR)/config/pmchart/Sample
 
 include $(BUILDRULES)
-
-.NOTPARALLEL:
-.ORDER:	domain.h $(OBJECTS)
-
-domain.h: ../../pmns/stdpmid
-	$(DOMAIN_MAKERULE)
diff --git a/src/pmdas/sample/domain.h b/src/pmdas/sample/domain.h
new file mode 100644
index 0000000..0aa641b
--- /dev/null
+++ b/src/pmdas/sample/domain.h
@@ -0,0 +1,4 @@
+/*
+ * built from ../../pmns/stdpmid
+ */
+#define SAMPLE 29
diff --git a/src/pmdas/sample/src/GNUmakefile b/src/pmdas/sample/src/GNUmakefile
index 3a92c30..3070c68 100644
--- a/src/pmdas/sample/src/GNUmakefile
+++ b/src/pmdas/sample/src/GNUmakefile
@@ -1,16 +1,17 @@
 #
+# Copyright (c) 2014 Red Hat.
 # Copyright (c) 2000,2004 Silicon Graphics, Inc.  All Rights Reserved.
-# 
+#
 # 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.
-# 
+#
 
 TOPDIR = ../../../..
 include $(TOPDIR)/src/include/builddefs
@@ -20,6 +21,7 @@ include $(TOPDIR)/src/include/builddefs
 # are building.
 #
 IAM = sample
+DOMAIN = SAMPLE
 CMDTARGET = pmda$(IAM)$(EXECSUFFIX)
 LIBTARGET = pmda_$(IAM).$(DSOSUFFIX)
 TARGETS = $(CMDTARGET) $(LIBTARGET)
@@ -31,27 +33,27 @@ CFILES = pmda.c sample.c percontext.c events.c
 HFILES = percontext.h events.h
 VERSION_SCRIPT = exports
 
-LDIRT = $(TARGETS) $(VERSION_SCRIPT)
-
-LCFLAGS = -DDYNAMIC_SPEC=\"$(PCP_PMDAS_DIR)/sample/dynamic.indom\"
+LDIRT = domain.h sample.log $(TARGETS) $(VERSION_SCRIPT)
 LCFLAGS += $(INVISIBILITY)
 LLDLIBS = $(PCP_PMDALIB)
+LSRCFILES = GNUmakefile.install
 
-default:	../domain.h $(TARGETS)
+default:	domain.h $(TARGETS)
 
 pmda.o sample.o percontext.o: percontext.h
 sample.o events.o: events.h
 pmda.o: $(VERSION_SCRIPT)
 
-../domain.h:
-	$(MAKE) -C .. domain.h
+domain.h: ../../../pmns/stdpmid
+	$(DOMAIN_MAKERULE)
 
 $(VERSION_SCRIPT):
 	$(VERSION_SCRIPT_MAKERULE)
 
 install:	default
 	$(INSTALL) -m 755 -d $(PMDADIR)
-	$(INSTALL) -m 755 $(CMDTARGET) $(LIBTARGET) $(PMDADIR)
+	$(INSTALL) -m 644 domain.h $(CFILES) $(HFILES) $(PMDADIR)
+	$(INSTALL) -m 644 GNUmakefile.install $(PMDADIR)/Makefile
 
 include $(BUILDRULES)
 
diff --git a/src/pmdas/sample/src/GNUmakefile.install b/src/pmdas/sample/src/GNUmakefile.install
new file mode 100644
index 0000000..a61aa7e
--- /dev/null
+++ b/src/pmdas/sample/src/GNUmakefile.install
@@ -0,0 +1,53 @@
+#
+# Copyright (c) 2014 Red Hat.
+# Copyright (c) 2000,2003,2004 Silicon Graphics, Inc.  All Rights Reserved.
+#
+# 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.
+#
+
+SHELL	= sh
+
+ifdef PCP_CONF
+include $(PCP_CONF)
+else
+include $(PCP_DIR)/etc/pcp.conf
+endif
+include $(PCP_INC_DIR)/builddefs
+
+# remove -Lpath and -Ipath options from builddefs CFLAGS value
+#
+PCP_LIBS        =
+TMP             := $(CFLAGS:-I%=)
+ifdef PCP_DIR
+# put -Ipath and -Lpath back but use paths for run-time environment
+#
+CFLAGS          = $(TMP) -I$(PCP_INC_DIR)/..
+LDFLAGS         = -L$(PCP_LIB_DIR)
+else
+CFLAGS          = $(TMP)
+endif
+
+IAM	= sample
+CFILES = pmda.c sample.c percontext.c events.c
+HFILES = percontext.h events.h
+
+LIBTARGET = pmda_$(IAM).$(DSOSUFFIX)
+CMDTARGET = pmda$(IAM)
+TARGETS = $(LIBTARGET) $(CMDTARGET)
+
+LLDLIBS	= -lpcp_pmda -lpcp -lm -ldl -lpthread
+LDIRT	= *.log help.dir help.pag
+
+default: $(TARGETS)
+
+install: default
+
+include $(PCP_INC_DIR)/buildrules
diff --git a/src/pmdas/sample/src/events.c b/src/pmdas/sample/src/events.c
index 31471a9..18b1803 100644
--- a/src/pmdas/sample/src/events.c
+++ b/src/pmdas/sample/src/events.c
@@ -15,9 +15,9 @@
  * for more details.
  */
 
-#include "pmapi.h"
-#include "impl.h"
-#include "pmda.h"
+#include <pcp/pmapi.h>
+#include <pcp/impl.h>
+#include <pcp/pmda.h>
 #include "events.h"
 
 static int		nfetch;
diff --git a/src/pmdas/sample/src/percontext.c b/src/pmdas/sample/src/percontext.c
index 77026b8..0c549df 100644
--- a/src/pmdas/sample/src/percontext.c
+++ b/src/pmdas/sample/src/percontext.c
@@ -15,9 +15,9 @@
  * for more details.
  */
 
-#include "pmapi.h"
-#include "impl.h"
-#include "pmda.h"
+#include <pcp/pmapi.h>
+#include <pcp/impl.h>
+#include <pcp/pmda.h>
 #include "percontext.h"
 
 typedef struct {
diff --git a/src/pmdas/sample/src/pmda.c b/src/pmdas/sample/src/pmda.c
index ce9ce1e..7e70a35 100644
--- a/src/pmdas/sample/src/pmda.c
+++ b/src/pmdas/sample/src/pmda.c
@@ -20,10 +20,10 @@
  * Generic driver for a daemon-based PMDA
  */
 
-#include "pmapi.h"
-#include "impl.h"
-#include "pmda.h"
-#include "../domain.h"
+#include <pcp/pmapi.h>
+#include <pcp/impl.h>
+#include <pcp/pmda.h>
+#include "domain.h"
 #include "percontext.h"
 
 extern void sample_init(pmdaInterface *);
diff --git a/src/pmdas/sample/src/sample.c b/src/pmdas/sample/src/sample.c
index 8b8dc0e..c499c9f 100644
--- a/src/pmdas/sample/src/sample.c
+++ b/src/pmdas/sample/src/sample.c
@@ -12,14 +12,14 @@
  * for more details.
  */
 
-#include "pmapi.h"
-#include "impl.h"
-#include "pmda.h"
-#include "percontext.h"
-#include "events.h"
 #include <limits.h>
 #include <sys/stat.h>
-#include "../domain.h"
+#include <pcp/pmapi.h>
+#include <pcp/impl.h>
+#include <pcp/pmda.h>
+#include "percontext.h"
+#include "events.h"
+#include "domain.h"
 #ifdef HAVE_SYSINFO
 /*
  * On Solaris, need <sys/systeminfo.h> and sysinfo() is different.
commit 5f102b1aa2816fc2e8c5e24674b83075f988ab03
Author: Nathan Scott <nathans@redhat.com>
Date:   Tue Feb 11 12:27:04 2014 +1100

    Changes to pmdatxmon to support multlib devel packages
    
    This removes architecture-dependent files in the development
    package related to pmdatxmon.  Instead of installing prebuilt
    binaries, we now use the pmdasimple/pmdatrivial technique of
    installing a makefile and generating them.

diff --git a/src/pmdas/txmon/GNUmakefile b/src/pmdas/txmon/GNUmakefile
index 61d2c0d..7c423ba 100644
--- a/src/pmdas/txmon/GNUmakefile
+++ b/src/pmdas/txmon/GNUmakefile
@@ -43,8 +43,7 @@ build-me:	$(TARGETS)
 
 install:	build-me
 	$(INSTALL) -m 755 -d $(PMDADIR)
-	$(INSTALL) -m 755 $(IAM) $(PMDADIR)/pmda$(IAM)
-	$(INSTALL) -m 755 txrecord $(SCRIPTS) $(PMDADIR)
+	$(INSTALL) -m 755 $(SCRIPTS) $(PMDADIR)
 	$(INSTALL) -m 644 $(DFILES) root $(HFILES) $(PMDADIR)
 	$(INSTALL) -m 644 help pmns domain.h $(CFILES) $(PMDADIR)
 	$(INSTALL) -m 644 GNUmakefile.install $(PMDADIR)/Makefile
commit 8d4a8eb3fcbee1d0f0e90cc6207b6db7b90dd5c8
Author: Nathan Scott <nathans@redhat.com>
Date:   Tue Feb 11 15:48:16 2014 +1100

    Changes to pcp.conf packaging to support "multilib" packaging
    
    Move the configuration files (pcp.conf in particular, as it is
    not architecture neutral) from pcp-libs into a new pcp-conf
    package packaging formats for both rpm and deb formats.
    
    As this is a fairly major packaging shift that people will at
    times probably need to refer back to, bump the minor version
    number (3.8.x -> 3.9.0).  A dependency exists between pcp-libs
    and pcp-conf of course, but this is no longer arch dependent.
    
    This is part two of three for rpm "multilib" support for pcp,
    where both 32 and 64 bit variants of the -libs and -libs-devel
    packages can be simultaneously installed.
    
    It also happens to resolve a long-standing Debian bug, so its
    got that goin' for it, which is nice.

diff --git a/debian/GNUmakefile b/debian/GNUmakefile
index acb049d..661b46a 100644
--- a/debian/GNUmakefile
+++ b/debian/GNUmakefile
@@ -36,6 +36,10 @@ PCPPMDAINFINIBAND = pcp-pmda-infiniband
 PCPPMDAINFINIBAND_FILES = pcp-pmda-infiniband.dirs pcp-pmda-infiniband.install
 PCPPMDAINFINIBAND_DOC_DIR = $(PCP_DOC_DIR)/../pcp-pmda-infiniband
 
+PCPCFG = pcp-conf
+PCPCFG_FILES = pcp-conf.dirs pcp-conf.install
+PCPCFG_DOC_DIR = $(PCP_DOC_DIR)/../pcp-conf
+
 LIBPCPPCP = libpcp3
 LIBPCP_FILES = libpcp3.dirs libpcp3.install
 DEVPCP_FILES = libpcp3-dev.dirs libpcp3-dev.install
@@ -88,7 +92,7 @@ LSRCFILES = changelog compat control copyright rules \
 	pcp.postrm.head pcp.postrm.tail configversions \
 	$(LINTIAN) $(PCP_LINT) \
 	$(PCP_FILES) $(LIBPCP_FILES) $(DEVPCP_FILES) \
-	$(PCPTESTSUITE_FILES) \
+	$(PCPCFG_FILES) $(PCPTESTSUITE_FILES) \
 	$(LIBGUI_FILES) $(DEVGUI_FILES) \
 	$(LIBMMV_FILES) $(DEVMMV_FILES) \
 	$(LIBPMDA_FILES) $(DEVPMDA_FILES) \
@@ -119,6 +123,13 @@ ifeq ($(PACKAGE_DISTRIBUTION), debian)
 	$(INSTALL) -m 644 changelog $(PCPTESTSUITEDIR)/changelog.Debian
 endif
 
+install-pcpcfg: default
+ifeq ($(PACKAGE_DISTRIBUTION), debian)
+	$(INSTALL) -m 755 -d $(PCPCFG_DOC_DIR)
+	$(INSTALL) -m 644 copyright $(PCPCFG_DOC_DIR)
+	$(INSTALL) -m 644 changelog $(PCPCFG_DOC_DIR)/changelog.Debian
+endif
+
 install-libpcp: default
 ifeq ($(PACKAGE_DISTRIBUTION), debian)
 	$(INSTALL) -m 755 -d $(LIBPCP_DOC_DIR)
diff --git a/debian/libpcp3.dirs b/debian/libpcp3.dirs
index 9a8b09a..e69de29 100644
--- a/debian/libpcp3.dirs
+++ b/debian/libpcp3.dirs
@@ -1 +0,0 @@
-usr/include/pcp
diff --git a/debian/libpcp3.install b/debian/libpcp3.install
index cdad482..ceab611 100644
--- a/debian/libpcp3.install
+++ b/debian/libpcp3.install
@@ -1,4 +1 @@
-etc/pcp.conf
 usr/lib/libpcp.so.3
-usr/include/pcp/builddefs
-usr/include/pcp/buildrules
diff --git a/debian/pcp-conf.dirs b/debian/pcp-conf.dirs
new file mode 100644
index 0000000..9a8b09a
--- /dev/null
+++ b/debian/pcp-conf.dirs
@@ -0,0 +1 @@
+usr/include/pcp
diff --git a/debian/pcp-conf.install b/debian/pcp-conf.install
new file mode 100644
index 0000000..98a9eba
--- /dev/null
+++ b/debian/pcp-conf.install
@@ -0,0 +1,3 @@
+etc/pcp.conf
+usr/include/pcp/builddefs
+usr/include/pcp/buildrules
commit 8fe72ef673aa98b419077f4a4f9852336dce4df0
Author: Nathan Scott <nathans@redhat.com>
Date:   Tue Feb 11 19:16:55 2014 +1100

    Final phase of rpm multilib support - workaround config.h differences
    
    Use the http://fedoraproject.org/wiki/PackagingDrafts/MultilibTricks
    technique ("myautoconf.h files with a size in them") for avoiding the
    final problem in terms of multilib support.

diff --git a/configure b/configure
index 1d34aab..b8ee2d8 100755
--- a/configure
+++ b/configure
@@ -4496,7 +4496,7 @@ if test -z "$PACKAGE_DISTRIBUTION" ; then
 fi
 
 
-ac_config_headers="$ac_config_headers src/include/pcp/config.h"
+ac_config_headers="$ac_config_headers src/include/pcp/config.h src/include/pcp/configsz.h"
 
 ac_config_files="$ac_config_files src/include/pcp/platform_defs.h"
 
@@ -5190,6 +5190,7 @@ for ac_config_target in $ac_config_targets
 do
   case $ac_config_target in
     "src/include/pcp/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/pcp/config.h" ;;
+    "src/include/pcp/configsz.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/pcp/configsz.h" ;;
     "src/include/pcp/platform_defs.h") CONFIG_FILES="$CONFIG_FILES src/include/pcp/platform_defs.h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -8739,12 +8740,13 @@ fi
 
 done
 
-for ac_header in execinfo.h
+for ac_header in execinfo.h bits/wordsize.h
 do :
-  ac_fn_c_check_header_mongrel "$LINENO" "execinfo.h" "ac_cv_header_execinfo_h" "$ac_includes_default"
-if test "x$ac_cv_header_execinfo_h" = xyes; then :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_EXECINFO_H 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -13987,6 +13989,7 @@ for ac_config_target in $ac_config_targets
 do
   case $ac_config_target in
     "src/include/pcp/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/pcp/config.h" ;;
+    "src/include/pcp/configsz.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/pcp/configsz.h" ;;
     "src/include/pcp/platform_defs.h") CONFIG_FILES="$CONFIG_FILES src/include/pcp/platform_defs.h" ;;
     "src/include/builddefs") CONFIG_FILES="$CONFIG_FILES src/include/builddefs" ;;
     "src/include/pcp.conf") CONFIG_FILES="$CONFIG_FILES src/include/pcp.conf" ;;
diff --git a/configure.in b/configure.in
index 4529e31..5fcdb9b 100644
--- a/configure.in
+++ b/configure.in
@@ -348,8 +348,8 @@ if test -z "$PACKAGE_DISTRIBUTION" ; then
 fi
 AC_SUBST(PACKAGE_DISTRIBUTION)
 
-dnl output header with cpp defs HAVE_*, etc
-AC_CONFIG_HEADER(src/include/pcp/config.h)
+dnl output header files with cpp defs HAVE_*, etc
+AC_CONFIG_HEADERS(src/include/pcp/config.h src/include/pcp/configsz.h)
 AC_OUTPUT(src/include/pcp/platform_defs.h)
 
 AC_CHECK_PROGS(GIT, git)
@@ -932,7 +932,7 @@ AC_CHECK_HEADERS(pwd.h grp.h regex.h sys/wait.h)
 AC_CHECK_HEADERS(termio.h termios.h sys/termios.h sys/ioctl.h)
 AC_CHECK_HEADERS(netdb.h sys/socket.h netinet/in.h netinet/tcp.h arpa/inet.h)
 AC_CHECK_HEADERS(windows.h winsock2.h ws2tcpip.h)
-AC_CHECK_HEADERS(execinfo.h)
+AC_CHECK_HEADERS(execinfo.h bits/wordsize.h)
 AC_CHECK_HEADERS(iptypes.h, [], [], [#include <windows.h>])
 
 dnl Check if we have <sys/endian.h> ... standard way
diff --git a/src/include/buildrules b/src/include/buildrules
index 9e2c48e..638ec17 100644
--- a/src/include/buildrules
+++ b/src/include/buildrules
@@ -112,6 +112,7 @@ realclean distclean: clean
 	rm -f $(TOPDIR)/src/include/builddefs \
 	      $(TOPDIR)/src/include/pcp.conf \
 	      $(TOPDIR)/src/include/pcp/config.h \
+	      $(TOPDIR)/src/include/pcp/configsz.h \
 	      $(TOPDIR)/src/include/pcp/platform_defs.h \
 	      $(TOPDIR)/src/include/pcp/pmdbg.h
 	rm -f $(TOPDIR)/build/GNUlocaldefs
diff --git a/src/include/pcp/GNUmakefile b/src/include/pcp/GNUmakefile
index 93cdd82..4aaf310 100644
--- a/src/include/pcp/GNUmakefile
+++ b/src/include/pcp/GNUmakefile
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2013 Red Hat.
+# Copyright (c) 2013-2014 Red Hat.
 # Copyright (c) 2000,2004 Silicon Graphics, Inc.  All Rights Reserved.
 # 
 # This program is free software; you can redistribute it and/or modify it
@@ -18,11 +18,13 @@ include $(TOPDIR)/src/include/builddefs
 -include ./GNUlocaldefs
 
 HFILES = pmapi.h impl.h pmda.h pmtime.h pmafm.h import.h \
-	 trace.h trace_dev.h mmv_stats.h mmv_dev.h
-GENERATED_HFILES = pmdbg.h platform_defs.h config.h
-CONFFILES = config.h platform_defs.h
+	 trace.h trace_dev.h mmv_stats.h mmv_dev.h \
+	 config32.h config64.h
+INFILES = config.h.in configsz.h.in platform_defs.h.in
+CONFFILES = config.h configsz.h platform_defs.h
+GENERATED_HFILES = pmdbg.h $(CONFFILES)
 
-LSRCFILES = config.h.in platform_defs.h.in mk_pmdbg fault.h
+LSRCFILES = mk_pmdbg fault.h $(INFILES)
 LDIRT = $(GENERATED_HFILES)
 
 default :: default_pcp
diff --git a/src/include/pcp/config.h.in b/src/include/pcp/config.h.in
index 2cef698..92f52ae 100644
--- a/src/include/pcp/config.h.in
+++ b/src/include/pcp/config.h.in
@@ -80,11 +80,25 @@ extern "C" {
 /* if compiler can cast __uint64_t to double */
 #undef HAVE_CAST_U64_DOUBLE
 
-/* long and pointer must be either 32 bit or 64 bit */
-#undef HAVE_64BIT_LONG
-#undef HAVE_32BIT_LONG
-#undef HAVE_32BIT_PTR
-#undef HAVE_64BIT_PTR
+/*
+ * long and pointer must be either 32 bit or 64 bit
+ *
+ * This is complicated by RPMs "multilib" feature, which requires there
+ * to be no differences between header files on 32 and 64 bit platforms.
+ */
+#undef HAVE_BITS_WORDSIZE_H
+#ifdef HAVE_BITS_WORDSIZE_H
+# include <bits/wordsize.h>
+# if __WORDSIZE == 32
+#  include "config32.h"
+# elif __WORDSIZE == 64
+#  include "config64.h"
+# else
+#  error "Unknown word size"
+# endif
+#else
+# include "configsz.h"
+#endif
 
 /* Define if header file is available */
 #undef HAVE_FCNTL_H
diff --git a/src/include/pcp/config32.h b/src/include/pcp/config32.h
new file mode 100644
index 0000000..64eba4c
--- /dev/null
+++ b/src/include/pcp/config32.h
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+
+#ifndef _PCP_CONFIG32_H
+#define _PCP_CONFIG32_H
+
+/* #undef HAVE_64BIT_LONG */
+#define HAVE_32BIT_LONG 1
+#define HAVE_32BIT_PTR 1
+/* #undef HAVE_64BIT_PTR */
+
+#endif /* _PCP_CONFIG32_H */
diff --git a/src/include/pcp/config64.h b/src/include/pcp/config64.h
new file mode 100644
index 0000000..4bae2ee
--- /dev/null
+++ b/src/include/pcp/config64.h
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+
+#ifndef _PCP_CONFIG64_H
+#define _PCP_CONFIG64_H
+
+#define HAVE_64BIT_LONG 1
+/* #undef HAVE_32BIT_LONG */
+/* #undef HAVE_32BIT_PTR */
+#define HAVE_64BIT_PTR 1
+
+#endif /* _PCP_CONFIG64_H */
diff --git a/src/include/pcp/configsz.h.in b/src/include/pcp/configsz.h.in
new file mode 100644
index 0000000..4a06e40
--- /dev/null
+++ b/src/include/pcp/configsz.h.in
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+#ifndef _PCP_CONFIGSZ_H
+#define _PCP_CONFIGSZ_H
+
+/* long and pointer must be either 32 bit or 64 bit */
+#undef HAVE_64BIT_LONG
+#undef HAVE_32BIT_LONG
+#undef HAVE_32BIT_PTR
+#undef HAVE_64BIT_PTR
+
+#endif /* _PCP_CONFIGSZ_H */