summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7ce65d4)
raw | patch | inline | side by side (parent: 7ce65d4)
author | Pshyk, SerhiyX <serhiyx.pshyk@intel.com> | |
Mon, 12 Jun 2017 12:58:12 +0000 (13:58 +0100) | ||
committer | Pshyk, SerhiyX <serhiyx.pshyk@intel.com> | |
Tue, 13 Jun 2017 07:19:45 +0000 (08:19 +0100) |
Change-Id: I172ad8535edda429cd58e0d6198aa19af76151eb
Signed-off-by: Serhiy Pshyk <serhiyx.pshyk@intel.com>
Signed-off-by: Serhiy Pshyk <serhiyx.pshyk@intel.com>
AUTHORS | patch | blob | history | |
Makefile.am | patch | blob | history | |
src/intel_pmu.c | patch | blob | history |
index d866c7004f70ec72719c4b056d6387c92d0283be..b99c156a11f141a7edbb4545055fcf41fa0338dc 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
Sebastien Pahl <sebastien.pahl at dotcloud.com>
- AMQP plugin.
+Serhiy Pshyk <serhiyx.pshyk at intel.com>
+ - intel_pmu plugin
+ - intel_rdt plugin
+ - snmp_agent plugin
+
Simon Kuhnle <simon at blarzwurst.de>
- OpenBSD code for the cpu and memory plugins.
diff --git a/Makefile.am b/Makefile.am
index 57641dd41d3e8a5fb237643e22ceee3a9030a037..c4667aef54f413ff591cc6455906bf899e3fe717 100644 (file)
--- a/Makefile.am
+++ b/Makefile.am
if BUILD_PLUGIN_INTEL_PMU
pkglib_LTLIBRARIES += intel_pmu.la
intel_pmu_la_SOURCES = src/intel_pmu.c
-intel_pmu_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBJEVENTS_CPPFLAGS)
+intel_pmu_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBJEVENTS_CPPFLAGS)
intel_pmu_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBJEVENTS_LDFLAGS)
intel_pmu_la_LIBADD = $(BUILD_WITH_LIBJEVENTS_LIBS)
endif
diff --git a/src/intel_pmu.c b/src/intel_pmu.c
index 87a713be6ab8676912e6438f2735f0ff1fcedd8c..ea7c83f1983d6fa0906ec825b96fc65fd90adb90 100644 (file)
--- a/src/intel_pmu.c
+++ b/src/intel_pmu.c
DEBUG(PMU_PLUGIN ": config : %#x", (unsigned)e->attr.config);
DEBUG(PMU_PLUGIN ": size : %d", e->attr.size);
}
-
- return;
}
static void pmu_dump_config(void) {
for (size_t i = 0; i < g_ctx.hw_events_count; i++) {
DEBUG(PMU_PLUGIN ": hardware_events[%zu]: %s", i, g_ctx.hw_events[i]);
}
-
- return;
}
#endif /* COLLECT_DEBUG */
}
static int pmu_config(oconfig_item_t *ci) {
- int ret = 0;
DEBUG(PMU_PLUGIN ": %s:%d", __FUNCTION__, __LINE__);
for (int i = 0; i < ci->children_num; i++) {
+ int ret = 0;
oconfig_item_t *child = ci->children + i;
if (strcasecmp("ReportHardwareCacheEvents", child->key) == 0) {
ret = cf_util_get_boolean(child, &g_ctx.sw_events);
} else {
ERROR(PMU_PLUGIN ": Unknown configuration parameter \"%s\".", child->key);
- ret = (-1);
+ ret = -1;
}
if (ret != 0) {
plugin_dispatch_values(&vl);
}
-static int pmu_dispatch_data(void) {
+static void pmu_dispatch_data(void) {
struct event *e;
pmu_submit_counter(-1, e->event, all_value);
}
}
-
- return 0;
}
static int pmu_read(__attribute__((unused)) user_data_t *ud) {
ret = read_all_events(g_ctx.event_list);
if (ret != 0) {
ERROR(PMU_PLUGIN ": Failed to read values of all events.");
- return 0;
+ return ret;
}
- ret = pmu_dispatch_data();
- if (ret != 0) {
- ERROR(PMU_PLUGIN ": Failed to dispatch event values.");
- return 0;
- }
+ pmu_dispatch_data();
return 0;
}
static int pmu_add_events(struct eventlist *el, uint32_t type,
- event_info_t *events, int count) {
+ event_info_t *events, size_t count) {
- for (int i = 0; i < count; i++) {
+ for (size_t i = 0; i < count; i++) {
/* Allocate memory for event struct that contains array of efd structs
for all cores */
struct event *e =
e->attr.type = type;
e->attr.config = events[i].config;
e->attr.size = PERF_ATTR_SIZE_VER0;
- e->next = NULL;
if (!el->eventlist)
el->eventlist = e;
if (el->eventlist_last)