47 #include <linux/version.h> 60 #define EVNAME_POWER_RMRM "PM_MRK_DATA_FROM_RMEM" 61 #define EVNAME_POWER_DL4 "PM_MRK_DATA_FROM_DL4" 62 #define EVNAME_POWER_LMEM "PM_MRK_DATA_FROM_LMEM" 88 int size =
sizeof(
evnames)/
sizeof(
const char*);
89 u64 sample_type = PERF_SAMPLE_CALLCHAIN
90 | PERF_SAMPLE_PERIOD | PERF_SAMPLE_TIME
91 | PERF_SAMPLE_IP | PERF_SAMPLE_ADDR
92 | PERF_SAMPLE_CPU | PERF_SAMPLE_TID
93 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) 94 | PERF_SAMPLE_DATA_SRC | PERF_SAMPLE_WEIGHT
100 for(
int i=0; i<size ; i++) {
101 struct perf_event_attr event_attr;
104 if (isPMU < 0)
continue;
132 memcpy(&einfo->
attr, &event_attr,
sizeof(
struct perf_event_attr));
static const char * evnames[]
static struct perf_mem_metric metric
int perf_skid_set_max_precise_ip(struct perf_event_attr *attr)
struct perf_event_attr attr
struct event_custom_s * metric_custom
metric_desc_t * hpcrun_set_metric_info_and_period(int metric_id, const char *name, MetricFlags_ValFmt_t valFmt, size_t period, metric_desc_properties_t prop)
long perf_event_open(struct perf_event_attr *hw_event, pid_t pid, int cpu, int group_fd, unsigned long flags)
enum threshold_e threshold_type
void * hpcrun_malloc(size_t size)
int perf_util_attr_init(const char *event_name, struct perf_event_attr *attr, bool usePeriod, u64 threshold, u64 sampletype)
#define METHOD_CALL(obj, meth,...)
int datacentric_hw_register(sample_source_t *self, event_custom_t *event, struct event_threshold_s *period)
#define EVNAME_POWER_RMRM
#define EVNAME_POWER_LMEM
int hpcrun_new_metric(void)
void datacentric_hw_handler(perf_mmap_data_t *mmap_data, cct_node_t *datacentric_node, cct_node_t *sample_node)
int pfmu_getEventAttribute(const char *eventname, struct perf_event_attr *event_attr)
#define metric_property_none