summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 96048f2)
raw | patch | inline | side by side (parent: 96048f2)
author | Serhiy Pshyk <serhiyx.pshyk@intel.com> | |
Fri, 6 Oct 2017 01:24:11 +0000 (02:24 +0100) | ||
committer | Serhiy Pshyk <serhiyx.pshyk@intel.com> | |
Fri, 6 Oct 2017 01:24:11 +0000 (02:24 +0100) |
Signed-off-by: Serhiy Pshyk <serhiyx.pshyk@intel.com>
src/intel_pmu.c | patch | blob | history |
diff --git a/src/intel_pmu.c b/src/intel_pmu.c
index 351f81b0bf14dacd8cb3da55fe6f37b92b111b19..fd2bd6f3c12498b02e183cbd50938f334ae5f545 100644 (file)
--- a/src/intel_pmu.c
+++ b/src/intel_pmu.c
meta_data_t *meta = NULL;
/* create meta data only if value was scaled */
- if (efd->val[1] != efd->val[2] && efd->val[2]) {
- meta = meta_data_create();
- if (meta == NULL) {
- ERROR(PMU_PLUGIN ": meta_data_create failed.");
- return NULL;
- }
+ if (efd->val[1] == efd->val[2] || !efd->val[2]) {
+ return NULL;
+ }
- meta_data_add_unsigned_int(meta, "intel_pmu:raw_count", efd->val[0]);
- meta_data_add_unsigned_int(meta, "intel_pmu:time_enabled", efd->val[1]);
- meta_data_add_unsigned_int(meta, "intel_pmu:time_running", efd->val[2]);
+ meta = meta_data_create();
+ if (meta == NULL) {
+ ERROR(PMU_PLUGIN ": meta_data_create failed.");
+ return NULL;
}
+ meta_data_add_unsigned_int(meta, "intel_pmu:raw_count", efd->val[0]);
+ meta_data_add_unsigned_int(meta, "intel_pmu:time_enabled", efd->val[1]);
+ meta_data_add_unsigned_int(meta, "intel_pmu:time_running", efd->val[2]);
+
return meta;
}
/* dispatch per CPU value */
pmu_submit_counter(i, e->event, value, meta);
- if (meta) {
- meta_data_destroy(meta);
- meta = NULL;
- }
+ meta_data_destroy(meta);
}
if (event_enabled > 0) {