+meta_data_t *pmu_event_get_meta(struct event *e, int cpu) {
+ meta_data_t *meta = NULL;
+
+ /* create meta data only if value was scaled */
+ if (e->efd[cpu].val[1] != e->efd[cpu].val[2] && e->efd[cpu].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", e->efd[cpu].val[0]);
+ meta_data_add_unsigned_int(meta, "intel_pmu:time_enabled",
+ e->efd[cpu].val[1]);
+ meta_data_add_unsigned_int(meta, "intel_pmu:time_running",
+ e->efd[cpu].val[2]);
+ }
+
+ return meta;
+}
+