144 static atomic_uint_least32_t global_persistent_id =
ATOMIC_VAR_INIT(12);
198 #define l_lt(a, b) cct_addr_lt(a, &(b)) 199 #define l_gt(a, b) cct_addr_gt(a, &(b)) 227 wf(cct, op, arg, level);
245 size_t*
cnt = (
size_t*) arg;
257 op(node, arg, level);
383 return node ? ! node->
children :
false;
438 new->right = found->
right;
462 return leaf_type || (!node->
children);
680 TMSG(DATA_WRITE,
"num metrics in a cct node = %d", num_metrics);
688 .tmp_node = &tmp_node,
692 .cct2metrics_map = cct2metrics_map
696 tmp_node.
metrics = &(metrics[0]);
773 merge(cct_a, cct_b, arg);
873 if(!path || ! path->
parent)
return root;
cct_node_t * hpcrun_cct_top_new(uint16_t lmid, uintptr_t lmip)
ip_normalized_t hpcrun_normalize_ip(void *unnormalized_ip, load_module_t *lm)
cct_node_t * hpcrun_cct_new_special(void *addr)
struct cct_node_t * parent
void hpcrun_cct_terminate_path(cct_node_t *node)
#define GENERAL_SPLAY_TREE(type, root, key, lt_field, gt_field, left, right, lt, gt)
static void walkset_l(cct_node_t *cct, cct_op_t fn, cct_op_arg_t arg, size_t level)
void hpcrun_cct_merge(cct_node_t *cct_a, cct_node_t *cct_b, merge_op_t merge, merge_op_arg_t arg)
hpcfmt_uint_t num_metrics
#define HPCRUN_FMT_RetainIdFlag
#define atomic_fetch_add_explicit(object, operand, order)
static struct @10 splay_cache
#define ATOMIC_VAR_INIT(value)
size_t hpcrun_cct_num_nodes(cct_node_t *cct)
void hpcrun_cct_insert_path(cct_node_t **root, cct_node_t *path)
static cct_node_t * splay(cct_node_t *cct, cct_addr_t *addr)
static papi_cuda_data_t local
bool hpcrun_cct_is_node_allocation(cct_node_t *node)
bool hpcrun_cct_is_root(cct_node_t *node)
void hpcrun_walk_path(cct_node_t *node, cct_op_t op, cct_op_arg_t arg)
hpcrun_fmt_cct_node_t * tmp_node
cct_node_t * hpcrun_cct_get_root(cct_node_t *node)
int hpcrun_get_num_metrics()
static cct_node_t * cct_child_find_cache(cct_node_t *cct, cct_addr_t *addr)
void hpcrun_cct_walk_node_1st_w_level(cct_node_t *cct, cct_op_t op, cct_op_arg_t arg, size_t level)
static void lwrite(cct_node_t *node, cct_op_arg_t arg, size_t level)
cct_node_t * hpcrun_cct_parent(cct_node_t *x)
struct cct_node_t * children
static bool hpcrun_fmt_node_type_root(uint16_t type)
hpcfmt_uint_t num_metrics
static void l_count(cct_node_t *n, cct_op_arg_t arg, size_t level)
static bool cct_addr_eq(const cct_addr_t *a, const cct_addr_t *b)
cct_node_t * hpcrun_cct_insert_addr(cct_node_t *node, cct_addr_t *frm)
struct cct_node_t * right
struct cct_node_t cct_node_t
cct_node_t * hpcrun_insert_special_node(cct_node_t *root, void *addr)
static void walk_path_l(cct_node_t *node, cct_op_t op, cct_op_arg_t arg, size_t level)
static void cct_disjoint_union_cached(cct_node_t *target, cct_node_t *src)
bool hpcrun_cct_is_leaf(cct_node_t *node)
lush_assoc_info_t as_info
void hpcrun_cct_retain(cct_node_t *x)
bool hpcrun_cct_is_node_root(cct_node_t *node)
#define NODE_TYPE_GLOBAL_VARIABLE
static void walk_child_lrs(cct_node_t *cct, cct_op_t op, cct_op_arg_t arg, size_t level, void(*wf)(cct_node_t *n, cct_op_t o, cct_op_arg_t a, size_t l))
int hpcrun_cct_fwrite(cct2metrics_t *cct2metrics_map, cct_node_t *cct, FILE *fs, epoch_flags_t flags)
cct_node_t * hpcrun_cct_new(void)
bool hpcrun_cct_is_node_memaccess(cct_node_t *node)
static uint32_t new_persistent_id()
static int hpcfmt_int8_fwrite(uint64_t val, FILE *outfs)
static void lush_lip_init(lush_lip_t *x)
static void help_cct_child_find_set_cache(cct_node_t *cct, cct_addr_t *addr)
epoch_flags_bitfield fields
#define NON_LUSH_ADDR_INI(id, ip)
void * hpcrun_malloc(size_t size)
metric_set_t * hpcrun_get_metric_set_specific(cct2metrics_t **map, cct_node_id_t cct_id)
bool hpcrun_cct_no_children(cct_node_t *node)
#define NODE_TYPE_MEMACCESS
lush_assoc_info_t as_info
void hpcrun_cct_set_node_variable(cct_node_t *node)
int32_t hpcrun_cct_persistent_id(cct_node_t *x)
cct_node_t * hpcrun_cct_new_partial(void)
void * hpcrun_malloc_freeable(size_t size)
int hpcrun_cct_retained(cct_node_t *x)
static cct_node_t * cct_node_create(cct_addr_t *addr, cct_node_t *parent)
void(* merge_op_t)(cct_node_t *a, cct_node_t *b, merge_op_arg_t arg)
static void l_insert_path(cct_node_t *node, cct_op_arg_t arg, size_t level)
cct2metrics_t * cct2metrics_map
int hpcrun_fmt_cct_node_fwrite(hpcrun_fmt_cct_node_t *x, epoch_flags_t flags, FILE *fs)
void hpcrun_cct_set_node_root(cct_node_t *root)
int metrics[MAX_EVENTS][MAX_METRICS]
cct_node_t * hpcrun_cct_insert_path_return_leaf(cct_node_t *path, cct_node_t *root)
#define NODE_TYPE_REGULAR
static bool cct_addr_lt(const cct_addr_t *a, const cct_addr_t *b)
static void merge_or_join(cct_node_t *n, cct_op_arg_t a, size_t l)
void hpcrun_cct_set_node_memaccess(cct_node_t *node)
<!-- ********************************************************************--> n<!-- HPCToolkit Experiment DTD --> n<!-- Version 2.1 --> n<!-- ********************************************************************--> n<!ELEMENT HPCToolkitExperiment(Header,(SecCallPathProfile|SecFlatProfile) *)> n<!ATTLIST HPCToolkitExperiment\n version CDATA #REQUIRED > n n<!-- ******************************************************************--> n n<!-- Info/NV:flexible name-value pairs:(n) ame;(t) ype;(v) alue --> n<!ELEMENT Info(NV *)> n<!ATTLIST Info\n n CDATA #IMPLIED > n<!ELEMENT NV EMPTY > n<!ATTLIST NV\n n CDATA #REQUIRED\n t CDATA #IMPLIED\n v CDATA #REQUIRED > n n<!-- ******************************************************************--> n<!-- Header --> n<!-- ******************************************************************--> n<!ELEMENT Header(Info *)> n<!ATTLIST Header\n n CDATA #REQUIRED > n n<!-- ******************************************************************--> n<!-- Section Header --> n<!-- ******************************************************************--> n<!ELEMENT SecHeader(MetricTable?, MetricDBTable?, TraceDBTable?, LoadModuleTable?, FileTable?, ProcedureTable?, Info *)> n n<!-- MetricTable:--> n<!ELEMENT MetricTable(Metric) * > n n<!-- Metric:(i) d;(n) ame --> n<!--(v) alue-type:transient type of values --> n<!--(t) ype:persistent type of metric --> n<!-- fmt:format;show;--> n<!ELEMENT Metric(MetricFormula *, Info?)> n<!ATTLIST Metric\n i CDATA #REQUIRED\n n CDATA #REQUIRED\n es CDATA #IMPLIED\n em CDATA #IMPLIED\n ep CDATA #IMPLIED\n v(raw|final|derived-incr|derived) \"raw\\ t (inclusive|exclusive|nil) \nil\\ partner CDATA #IMPLIED\ fmt CDATA #IMPLIED\ show (1|0) \1\\ show-percent (1|0) \1> n n<!-- MetricFormula represents derived metrics: (t)ype; (frm): formula --> n<!ELEMENT MetricFormula (Info?)> n<!ATTLIST MetricFormula\ t (combine|finalize) \finalize\\ i CDATA #IMPLIED\ frm CDATA #REQUIRED> n n<!-- Metric data, used in sections: (n)ame [from Metric]; (v)alue --> n<!ELEMENT M EMPTY> n<!ATTLIST M\ n CDATA #REQUIRED\ v CDATA #REQUIRED> n n<!-- MetricDBTable: --> n<!ELEMENT MetricDBTable (MetricDB)*> n n<!-- MetricDB: (i)d; (n)ame --> n<!-- (t)ype: persistent type of metric --> n<!-- db-glob: file glob describing files in metric db --> n<!-- db-id: id within metric db --> n<!-- db-num-metrics: number of metrics in db --> n<!-- db-header-sz: size (in bytes) of a db file header --> n<!ELEMENT MetricDB EMPTY> n<!ATTLIST MetricDB\ i CDATA #REQUIRED\ n CDATA #REQUIRED\ t (inclusive|exclusive|nil) \nil\\ partner CDATA #IMPLIED\ db-glob CDATA #IMPLIED\ db-id CDATA #IMPLIED\ db-num-metrics CDATA #IMPLIED\ db-header-sz CDATA #IMPLIED> n n<!-- TraceDBTable: --> n<!ELEMENT TraceDBTable (TraceDB)> n n<!-- TraceDB: (i)d --> n<!-- db-min-time: min beginning time stamp (global) --> n<!-- db-max-time: max ending time stamp (global) --> n<!ELEMENT TraceDB EMPTY> n<!ATTLIST TraceDB\ i CDATA #REQUIRED\ db-glob CDATA #IMPLIED\ db-min-time CDATA #IMPLIED\ db-max-time CDATA #IMPLIED\ db-header-sz CDATA #IMPLIED> n n<!-- LoadModuleTable assigns a short name to a load module --> n<!ELEMENT LoadModuleTable (LoadModule)*> n n<!ELEMENT LoadModule (Info?)> n<!ATTLIST LoadModule\ i CDATA #REQUIRED\ n CDATA #REQUIRED> n n<!-- FileTable assigns a short name to a file --> n<!ELEMENT FileTable (File)*> n n<!ELEMENT File (Info?)> n<!ATTLIST File\ i CDATA #REQUIRED\ n CDATA #REQUIRED> n n<!-- ProcedureTable assigns a short name to a procedure --> n<!ELEMENT ProcedureTable (Procedure)*> n n<!-- Info/NV: flexible name-value pairs: (n)ame; (t)ype; (v)alue --> n<!-- f: family of the procedure (fake, root, ...)--> n<!ELEMENT Procedure (Info?)> n<!ATTLIST Procedure\ i CDATA #REQUIRED\ n CDATA #REQUIRED\ f CDATA #IMPLIED> n n<!-- ****************************************************************** --> n<!-- Section: Call path profile --> n<!-- ****************************************************************** --> n<!ELEMENT SecCallPathProfile (SecHeader, SecCallPathProfileData)> n<!ATTLIST SecCallPathProfile\ i CDATA #REQUIRED\ n CDATA #REQUIRED> n n<!ELEMENT SecCallPathProfileData (PF|M)*> n<!-- Procedure frame --> n<!-- (i)d: unique identifier for cross referencing --> n<!-- (s)tatic scope id --> n<!-- (n)ame: a string or an id in ProcedureTable --> n<!-- (lm) load module: a string or an id in LoadModuleTable --> n<!-- (f)ile name: a string or an id in LoadModuleTable --> n<!-- (l)ine range: \beg-end\ (inclusive range) --> n<!-- (a)lien: whether frame is alien to enclosing P --> n<!-- (str)uct: hpcstruct node id --> n<!-- (t)ype: hpcrun node type: memory access, variable declaration, ... --> n<!-- (v)ma-range-set: \{[beg-end), [beg-end)...}\ --> n<!ELEMENT PF (PF|Pr|L|C|S|M)*> n<!ATTLIST PF\ i CDATA #IMPLIED\ s CDATA #IMPLIED\ n CDATA #REQUIRED\ lm CDATA #IMPLIED\ f CDATA #IMPLIED\ l CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Procedure (static): GOAL: replace with 'P' --> n<!ELEMENT Pr (Pr|L|C|S|M)*> n<!ATTLIST Pr\ i CDATA #IMPLIED\ s CDATA #IMPLIED\ n CDATA #REQUIRED\ lm CDATA #IMPLIED\ f CDATA #IMPLIED\ l CDATA #IMPLIED\ a (1|0) \0\\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Callsite (a special StatementRange) --> n<!ELEMENT C (PF|M)*> n<!ATTLIST C\ i CDATA #IMPLIED\ s CDATA #IMPLIED\ l CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n n<!-- ****************************************************************** --> n<!-- Section: Flat profile --> n<!-- ****************************************************************** --> n<!ELEMENT SecFlatProfile (SecHeader, SecFlatProfileData)> n<!ATTLIST SecFlatProfile\ i CDATA #REQUIRED\ n CDATA #REQUIRED> n n<!ELEMENT SecFlatProfileData (LM|M)*> n<!-- Load module: (i)d; (n)ame; (v)ma-range-set --> n<!ELEMENT LM (F|P|M)*> n<!ATTLIST LM\ i CDATA #IMPLIED\ n CDATA #REQUIRED\ v CDATA #IMPLIED> n<!-- File --> n<!ELEMENT F (P|L|S|M)*> n<!ATTLIST F\ i CDATA #IMPLIED\ n CDATA #REQUIRED> n<!-- Procedure (Note 1) --> n<!ELEMENT P (P|A|L|S|C|M)*> n<!ATTLIST P\ i CDATA #IMPLIED\ n CDATA #REQUIRED\ l CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Alien (Note 1) --> n<!ELEMENT A (A|L|S|C|M)*> n<!ATTLIST A\ i CDATA #IMPLIED\ f CDATA #IMPLIED\ n CDATA #IMPLIED\ l CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Loop (Note 1,2) --> n<!ELEMENT L (A|Pr|L|S|C|M)*> n<!ATTLIST L\ i CDATA #IMPLIED\ s CDATA #IMPLIED\ l CDATA #IMPLIED\ f CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Statement (Note 2) --> n<!-- (it): trace record identifier --> n<!ELEMENT S (S|M)*> n<!ATTLIST S\ i CDATA #IMPLIED\ it CDATA #IMPLIED\ s CDATA #IMPLIED\ l CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Note 1: Contained Cs may not contain PFs --> n<!-- Note 2: The 's' attribute is not used for flat profiles --> n
void hpcrun_cct_set_node_allocation(cct_node_t *node)
void hpcrun_cct_walkset(cct_node_t *cct, cct_op_t fn, cct_op_arg_t arg)
#define NODE_TYPE_ALLOCATION
cct_node_t * hpcrun_cct_find_addr(cct_node_t *cct, cct_addr_t *addr)
hpcrun_metricVal_t * metrics
void(* cct_op_t)(cct_node_t *cct, cct_op_arg_t arg, size_t level)
void hpcrun_cct_walk_child_1st_w_level(cct_node_t *cct, cct_op_t op, cct_op_arg_t arg, size_t level)
cct_node_t * hpcrun_cct_insert_node(cct_node_t *target, cct_node_t *src)
bool hpcrun_cct_is_node_variable(cct_node_t *node)
static void hpcrun_cct_walk_node_1st(cct_node_t *cct, cct_op_t op, cct_op_arg_t arg)
cct_addr_t * hpcrun_cct_addr(cct_node_t *node)
void hpcrun_metric_set_dense_copy(cct_metric_data_t *dest, metric_set_t *set, int num_metrics)