From 31a132935053329fb34c599f4224c7b08e5ac3f9 Mon Sep 17 00:00:00 2001 From: Deepak S Date: Sat, 2 Sep 2017 19:28:08 -0700 Subject: Adding intel_pmu tools plugin for collectd Change-Id: I81ff3d43d209e98188855c8b2eb302835bb5d417 Signed-off-by: Neha Vadnere Signed-off-by: Deepak S Signed-off-by: Ross Brattain --- yardstick/network_services/nfvi/collectd.conf | 8 ++++++++ yardstick/network_services/nfvi/collectd.sh | 23 ++++++++++++++++++++--- yardstick/network_services/nfvi/resource.py | 11 +++++++++-- 3 files changed, 37 insertions(+), 5 deletions(-) (limited to 'yardstick/network_services/nfvi') diff --git a/yardstick/network_services/nfvi/collectd.conf b/yardstick/network_services/nfvi/collectd.conf index 6d8b73f7f..3928dcbca 100644 --- a/yardstick/network_services/nfvi/collectd.conf +++ b/yardstick/network_services/nfvi/collectd.conf @@ -67,6 +67,14 @@ Interval {interval} Cores "" + + ReportHardwareCacheEvents true + ReportKernelPMUEvents true + ReportSoftwareEvents true + EventList "/root/.cache/pmu-events/GenuineIntel-6-2D-core.json" + HardwareEvents "L2_RQSTS.CODE_RD_HIT,L2_RQSTS.CODE_RD_MISS" "L2_RQSTS.ALL_CODE_RD" + + ReportPerNodeHP true ReportRootHP true diff --git a/yardstick/network_services/nfvi/collectd.sh b/yardstick/network_services/nfvi/collectd.sh index 7666404e4..296c4a213 100755 --- a/yardstick/network_services/nfvi/collectd.sh +++ b/yardstick/network_services/nfvi/collectd.sh @@ -104,6 +104,24 @@ else popd fi +ls $INSTALL_NSB_BIN/pmu-tools >/dev/null +if [ $? -eq 0 ] +then + echo "DPDK already installed. Done" +else + cd $INSTALL_NSB_BIN + + git clone https://github.com/andikleen/pmu-tools.git + cd pmu-tools + cd jevents + sed -i -e 's/CFLAGS := -g -Wall -O2 -Wno-unused-result/CFLAGS := -g -Wall -O2 -Wno-unused-result -fPIC/g' Makefile + make + sudo make install + cd $INSTALL_NSB_BIN/pmu-tools + python event_download.py +fi + +cd $INSTALL_NSB_BIN which $INSTALL_NSB_BIN/collectd/collectd >/dev/null if [ $? -eq 0 ] then @@ -115,9 +133,8 @@ else git clone https://github.com/collectd/collectd.git pushd collectd git stash - git checkout -b nfvi 47c86ace348a1d7a5352a83d10935209f89aa4f5 ./build.sh - ./configure --with-libpqos=/usr/ --with-libdpdk=/usr --with-libyajl=/usr/local --enable-debug --enable-dpdkstat --enable-virt --enable-ovs_stats + ./configure --with-libpqos=/usr/ --with-libdpdk=/usr --with-libyajl=/usr/local --with-libjevents=/usr/local --enable-debug --enable-dpdkstat --enable-virt --enable-ovs_stats --enable-intel_pmu --prefix=$INSTALL_NSB_BIN/collectd make install > /dev/null popd echo "Done." @@ -126,7 +143,7 @@ fi modprobe msr cp $INSTALL_NSB_BIN/collectd.conf /opt/collectd/etc/ - +sudo service rabbitmq-server restart echo "Check if admin user already created" rabbitmqctl list_users | grep '^admin$' > /dev/null if [ $? -eq 0 ]; diff --git a/yardstick/network_services/nfvi/resource.py b/yardstick/network_services/nfvi/resource.py index 2a9a1a1a2..f0ae67616 100644 --- a/yardstick/network_services/nfvi/resource.py +++ b/yardstick/network_services/nfvi/resource.py @@ -35,7 +35,7 @@ CONF = cfg.CONF ZMQ_OVS_PORT = 5567 ZMQ_POLLING_TIME = 12000 LIST_PLUGINS_ENABLED = ["amqp", "cpu", "cpufreq", "intel_rdt", "memory", - "hugepages", "dpdkstat", "virt", "ovs_stats"] + "hugepages", "dpdkstat", "virt", "ovs_stats", "intel_pmu"] class ResourceProfile(object): @@ -109,6 +109,10 @@ class ResourceProfile(object): def parse_ovs_stats(cls, key, value): return cls.parse_simple_resource(key, value) + @classmethod + def parse_intel_pmu_stats(cls, key, value): + return {''.join(key): value.split(":")[1]} + def parse_collectd_result(self, metrics, core_list): """ convert collectd data into json""" result = { @@ -118,6 +122,7 @@ class ResourceProfile(object): "dpdkstat": {}, "virt": {}, "ovs_stats": {}, + "intel_pmu": {}, } testcase = "" @@ -148,6 +153,9 @@ class ResourceProfile(object): elif "ovs_stats" in res_key0: result["ovs_stats"].update(self.parse_ovs_stats(key_split, value)) + elif "intel_pmu-all" in res_key0: + result["intel_pmu"].update(self.parse_intel_pmu_stats(res_key1, value)) + result["timestamp"] = testcase return result @@ -192,7 +200,6 @@ class ResourceProfile(object): "loadplugin": loadplugin, "dpdk_interface": interfaces, } - self._provide_config_file(bin_path, 'collectd.conf', kwargs) def _start_collectd(self, connection, bin_path): -- cgit 1.2.3-korg