diff options
author | 2017-09-02 19:28:08 -0700 | |
---|---|---|
committer | 2017-09-04 20:32:55 -0700 | |
commit | 31a132935053329fb34c599f4224c7b08e5ac3f9 (patch) | |
tree | a8505b5db589e54b750ef82828a5455640235f4c /yardstick | |
parent | cc3c8c7971c6a610f2cd30d505a916c3fa29a910 (diff) |
Adding intel_pmu tools plugin for collectd
Change-Id: I81ff3d43d209e98188855c8b2eb302835bb5d417
Signed-off-by: Neha Vadnere <neha.r.vadnere@intel.com>
Signed-off-by: Deepak S <deepak.s@linux.intel.com>
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Diffstat (limited to 'yardstick')
-rw-r--r-- | yardstick/network_services/nfvi/collectd.conf | 8 | ||||
-rwxr-xr-x | yardstick/network_services/nfvi/collectd.sh | 23 | ||||
-rw-r--r-- | yardstick/network_services/nfvi/resource.py | 11 |
3 files changed, 37 insertions, 5 deletions
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 "" </Plugin> +<Plugin intel_pmu> + 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" +</Plugin> + <Plugin hugepages> 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): |