103 TMSG(BT_INSERT,
"%s : start", __func__);
104 if (!cct)
return NULL;
107 if (path_beg < path_end) {
108 return cct_backtrace_null_handler(cct);
113 for(; path_beg >= path_end; path_beg--){
115 (path_beg >= path_end + 1) &&
118 TMSG(REC_COMPRESS,
"recursive routine compression!");
124 .lip = path_beg->
lip};
140 TMSG(REC_COMPRESS,
"retain_recursion set to %s", mode ?
"true" :
"false");
149 TMSG(FENCE,
"insert backtrace into treenode %p", treenode);
150 TMSG(FENCE,
"backtrace below");
151 bool bt_ins =
ENABLED(BT_INSERT);
157 if (! bt_ins)
DISABLE(BT_INSERT);
205 upd_proc(metric_id, mset, datum);
251 TMSG(LUSH,
"lush backtrace2cct invoked");
256 TMSG(BT_INSERT,
"regular (NON-lush) backtrace2cct invoked");
258 metricId, metricIncr,
259 skipInner, isSync, custom_update);
276 TMSG(FENCE,
"Recording backtrace");
279 TMSG(FENCE,
"Initially picking tree root = %p", cct_cursor);
283 TMSG(FENCE,
"Tramp found ==> cursor = %p", cct_cursor);
287 TMSG(FENCE,
"Partial unwind ==> cursor = %p", cct_cursor);
289 if (bt->
fence == FENCE_THREAD) {
291 TMSG(FENCE,
"Thread stop ==> cursor = %p", cct_cursor);
304 TMSG(FENCE,
"sanity check cursor = %p", cct_cursor);
305 TMSG(FENCE,
"further sanity check: bt->last frame = (%d, %p)",
319 TMSG(FENCE,
"Recording backtrace");
320 TMSG(BT_INSERT,
"Record backtrace w metric to id %d, incr = %d",
321 metricId, metricIncr.
i);
325 TMSG(FENCE,
"Initially picking tree root = %p", cct_cursor);
329 TMSG(FENCE,
"Tramp found ==> cursor = %p", cct_cursor);
333 TMSG(FENCE,
"Partial unwind ==> cursor = %p", cct_cursor);
335 if (bt->
fence == FENCE_THREAD) {
337 TMSG(FENCE,
"Thread stop ==> cursor = %p", cct_cursor);
342 TMSG(FENCE,
"sanity check cursor = %p", cct_cursor);
343 TMSG(FENCE,
"further sanity check: bt->last frame = (%d, %p)",
358 int skipInner,
int isSync,
377 if ( bt.
fence == FENCE_MAIN &&
397 TMSG(PARTIAL_UNW,
"recording partial unwind from graceful failure, " 398 "len partial unw = %d", (bt.
last - bt.
begin)+1);
404 tramp_found, metricId, metricIncr,
414 TMSG(TRAMP,
"--NEW SAMPLE--: Remove old trampoline");
417 TMSG(TRAMP,
"--NEW SAMPLE--: Insert new trampoline");
void hpcrun_trampoline_insert(cct_node_t *node)
#define ip_normalized_NULL
void hpcrun_cct_terminate_path(cct_node_t *node)
void hpcrun_stats_num_samples_dropped_inc(void)
bool hpcrun_generate_backtrace(backtrace_info_t *bt, ucontext_t *context, int skipInner)
metric_set_t * hpcrun_reify_metric_set(cct_node_id_t cct_id)
static void * hpcrun_frame_get_unnorm(frame_t *frame)
void hpcrun_stats_frames_total_inc(long amt)
void hpcrun_stats_num_samples_partial_inc(void)
void metric_upd_proc_t(int metric_id, metric_set_t *set, cct_metric_data_t datum)
cct_node_t * hpcrun_cct_insert_bt(cct_node_t *node, int metricId, backtrace_t *bt, cct_metric_data_t datum, void **trace_pc)
static bool hpcrun_isLogicalUnwind()
hpcrun_cct_update_after_t update_after_fn
ip_normalized_t the_function
static bool retain_recursion
static cct_node_t * cct_insert_raw_backtrace(cct_node_t *cct, frame_t *path_beg, frame_t *path_end)
static cct_node_t * help_hpcrun_backtrace2cct(cct_bundle_t *cct, ucontext_t *context, int metricId, hpcrun_metricVal_t metricIncr, int skipInner, int isSync, struct cct_custom_update_s *custom_update)
cct_node_t * hpcrun_cct_record_backtrace(cct_bundle_t *cct, bool partial, backtrace_info_t *bt, bool tramp_found)
cct_node_t * hpcrun_cct_record_backtrace_w_metric(cct_bundle_t *cct, bool partial, backtrace_info_t *bt, bool tramp_found, int metricId, hpcrun_metricVal_t metricIncr, struct cct_custom_update_s *custom_update)
cct_node_t * hpcrun_cct_parent(cct_node_t *x)
metric_upd_proc_t * hpcrun_get_metric_proc(int metric_id)
#define lush_assoc_info__set_assoc(x, new_as)
cct_node_t * hpcrun_cct_insert_addr(cct_node_t *node, cct_addr_t *frm)
cct_node_t * lush_backtrace2cct(cct_bundle_t *cct, ucontext_t *context, int metricId, hpcrun_metricVal_t metricIncr, int skipInner, int isSync)
struct cct_addr_t cct_addr_t
void hpcrun_stats_trolled_inc(void)
static lush_assoc_t lush_assoc_info__get_assoc(lush_assoc_info_t x)
cct_node_t * hpcrun_backtrace2cct(cct_bundle_t *cct, ucontext_t *context, int metricId, hpcrun_metricVal_t metricIncr, int skipInner, int isSync, struct cct_custom_update_s *custom_update)
lush_assoc_info_t as_info
cct_node_t * partial_unw_root
cct_node_t * cct_cursor_finalize(cct_bundle_t *cct, backtrace_info_t *bt, cct_node_t *cursor)
cct_node_t * tramp_cct_node
void hpcrun_stats_trolled_frames_inc(long amt)
hpcrun_cct_update_before_t update_before_fn
enum lush_assoc lush_assoc_t
static bool ip_normalized_eq(const ip_normalized_t *a, const ip_normalized_t *b)
lush_assoc_info_t as_info
cct_node_t * hpcrun_cct_insert_path_return_leaf(cct_node_t *path, cct_node_t *root)
cct_node_t * hpcrun_cct_insert_backtrace(cct_node_t *treenode, frame_t *path_beg, frame_t *path_end)
void hpcrun_bt_dump(frame_t *unwind, const char *tag)
void cct_backtrace_finalize(backtrace_info_t *bt, int isSync)
<!-- ********************************************************************--> 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
bool hpcrun_inbounds_main(void *addr)
void hpcrun_trampoline_remove(void)
void hpcrun_set_retain_recursion_mode(bool mode)
cct_node_t * hpcrun_cct_insert_backtrace_w_metric(cct_bundle_t *cct, cct_node_t *treenode, int metric_id, frame_t *path_beg, frame_t *path_end, cct_metric_data_t datum, struct cct_custom_update_s *custom_update)
thread_data_t *(* hpcrun_get_thread_data)(void)
cct_addr_t * hpcrun_cct_addr(cct_node_t *node)