39 #define THREAD_LOCAL_MAP() TD_GET(core_profile_trace_data.cct2metrics_map) 54 TMSG(CCT2METRICS,
"Init, map = %p", *map);
70 for (
int i=0; i<indent; i++) buf[i] =
' ';
72 snprintf(buf+indent,
sizeof(buf)-(indent+1),
"%p", tree->
node);
73 TMSG(CCT2METRICS,
"%s", buf);
81 TMSG(CCT2METRICS,
"Splay tree %p appears below", map);
89 TMSG(CCT2METRICS,
"splay map = %p, node = %p", map, node);
91 TMSG(CCT2METRICS,
"new map = %p, top node = %p", map, map->
node);
117 TMSG(CCT2METRICS,
"REIFY: %p", cct_id);
119 TMSG(CCT2METRICS,
" -- Metric set found = %p", rv);
123 TMSG(CCT2METRICS,
" -- Metric set was null, allocating new metric set");
125 TMSG(CCT2METRICS,
"REIFY returns %p", rv);
139 TMSG(CCT2METRICS,
"GET_METRIC_SET for %p, using map %p", cct_id, map);
140 if (! current_map)
return NULL;
142 current_map =
splay(current_map, cct_id);
149 TMSG(CCT2METRICS,
" -- After Splay map = %p", cct_id, map);
151 if (current_map->
node == cct_id) {
152 TMSG(CCT2METRICS,
" -- found %p, returning metrics", current_map->
node);
155 TMSG(CCT2METRICS,
" -- cct_id NOT, found. Return NULL");
184 TMSG(CCT2METRICS,
"CCT2METRICS_ASSOC for %p, using map %p", node, map);
187 TMSG(CCT2METRICS,
" -- new map created: %p", map);
191 map =
splay(map, node);
192 TMSG(CCT2METRICS,
" -- map after splay = %p," 193 " node sought = %p, mapnode = %p", map, node, map->
node);
194 if (map->
node == node) {
195 EMSG(
"CCT2METRICS map assoc invariant violated");
198 if (map->
node < node) {
199 TMSG(CCT2METRICS,
" -- less-than insert %p < %p", map->
node, node);
205 TMSG(CCT2METRICS,
" -- greater-than insert %p > %p", map->
node, node);
206 new->left = map->
left;
211 TMSG(CCT2METRICS,
" -- new map after insertion %p.(%p, %p)", map->
node, map->
left, map->
right);
void hpcrun_cct2metrics_init(cct2metrics_t **map)
metric_set_t * hpcrun_reify_metric_set(cct_node_id_t cct_id)
bool hpcrun_has_metric_set(cct_node_id_t cct_id)
static cct2metrics_t * splay(cct2metrics_t *map, cct_node_id_t node)
struct cct2metrics_t * right
void splay_tree_dump(cct2metrics_t *map)
#define THREAD_LOCAL_MAP()
#define REGULAR_SPLAY_TREE(type, root, key, value, left, right)
void cct2metrics_assoc(cct_node_id_t node, metric_set_t *metrics)
static cct2metrics_t * cct2metrics_new(cct_node_id_t node, metric_set_t *metrics)
void * hpcrun_malloc(size_t size)
metric_set_t * hpcrun_get_metric_set_specific(cct2metrics_t **map, cct_node_id_t cct_id)
metric_set_t * hpcrun_get_metric_set(cct_node_id_t cct_id)
metric_set_t * hpcrun_metric_set_new(void)
void help_splay_tree_dump(cct2metrics_t *tree, int indent)
struct cct2metrics_t * left