47 #include <linux/version.h> 120 #define P(a, b) PERF_MEM_##a##_##b 141 u64 lvl = data_src->mem_lvl;
142 u64 snoop = data_src->mem_snoop;
155 if ( lvl &
P(LVL, HIT) ) {
158 if (lvl &
P(LVL, IO)) data_mem.
ld_io++;
159 if (lvl &
P(LVL, LFB)) data_mem.
ld_fbhit++;
160 if (lvl &
P(LVL, L1 )) data_mem.
ld_l1hit++;
161 if (lvl &
P(LVL, L2 )) data_mem.
ld_l2hit++;
162 if (lvl &
P(LVL, L3 )) {
163 if (snoop &
P(SNOOP, HITM))
169 if (lvl &
P(LVL, LOC_RAM)) {
171 if (snoop &
P(SNOOP, HIT))
177 if ((lvl &
P(LVL, REM_RAM1)) ||
178 (lvl &
P(LVL, REM_RAM2))) {
181 if (snoop &
P(SNOOP, HIT))
191 if ((lvl &
P(LVL, REM_CCE1)) ||
192 (lvl &
P(LVL, REM_CCE2))) {
193 if (snoop &
P(SNOOP, HIT)) {
196 else if (snoop &
P(SNOOP, HITM)) {
215 if ((lvl &
P(LVL, MISS))) {
232 u64 lvl = data_src->mem_lvl;
234 if (lvl &
P(LVL, HIT)) {
236 if (lvl &
P(LVL, L1 )) {
242 if (lvl &
P(LVL, MISS))
243 if (lvl &
P(LVL, L1)) {
302 if (data_src.mem_op &
P(
OP, LOAD)) {
305 if (data_src.mem_op &
P(
OP, STORE)) {
317 u64 sample_type = PERF_SAMPLE_CALLCHAIN
318 | PERF_SAMPLE_PERIOD | PERF_SAMPLE_TIME
319 | PERF_SAMPLE_IP | PERF_SAMPLE_ADDR
320 | PERF_SAMPLE_CPU | PERF_SAMPLE_TID
321 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) 322 | PERF_SAMPLE_DATA_SRC | PERF_SAMPLE_WEIGHT
329 for(
int i=0; i<size ; i++) {
334 struct perf_event_attr event_attr;
335 memset(&event_attr, 0,
sizeof(event_attr));
362 memcpy(&einfo->
attr, &event_attr,
sizeof(
struct perf_event_attr));
static void create_metric_addons()
metric_aux_info_t * perf_event_info
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
static void cct_metric_data_increment(int metric_id, cct_node_t *x, cct_metric_data_t incr)
struct pmu_config_s pmu_events[]
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)
static void datacentric_record_metric(int metric_id, cct_node_t *cct_node, cct_node_t *cct_datacentric, cct_metric_data_t value)
enum threshold_e threshold_type
core_profile_trace_data_t core_profile_trace_data
void * hpcrun_malloc(size_t size)
static void datacentric_record_load_mem(cct_node_t *node, cct_node_t *datacentric_node, perf_mem_data_src_t *data_src)
int perf_util_attr_init(const char *event_name, struct perf_event_attr *attr, bool usePeriod, u64 threshold, u64 sampletype)
int datacentric_hw_register(sample_source_t *self, event_custom_t *event, struct event_threshold_s *period)
void datacentric_hw_handler(perf_mmap_data_t *mmap_data, cct_node_t *datacentric_node, cct_node_t *sample_node)
#define METHOD_CALL(obj, meth,...)
hpcrun_metricVal_t cct_metric_data_t
int hpcrun_new_metric(void)
metric_desc_t * hpcrun_set_metric_info(int metric_id, const char *name)
union perf_mem_data_src perf_mem_data_src_t
thread_data_t *(* hpcrun_get_thread_data)(void)
int pfmu_getEventAttribute(const char *eventname, struct perf_event_attr *event_attr)
#define metric_property_none
static void datacentric_record_store_mem(cct_node_t *node, cct_node_t *datacentric_node, perf_mem_data_src_t *data_src)