HPCToolkit
metrics.c
Go to the documentation of this file.
1 // -*-Mode: C++;-*- // technically C99
2 
3 // * BeginRiceCopyright *****************************************************
4 //
5 // $HeadURL$
6 // $Id$
7 //
8 // --------------------------------------------------------------------------
9 // Part of HPCToolkit (hpctoolkit.org)
10 //
11 // Information about sources of support for research and development of
12 // HPCToolkit is at 'hpctoolkit.org' and in 'README.Acknowledgments'.
13 // --------------------------------------------------------------------------
14 //
15 // Copyright ((c)) 2002-2019, Rice University
16 // All rights reserved.
17 //
18 // Redistribution and use in source and binary forms, with or without
19 // modification, are permitted provided that the following conditions are
20 // met:
21 //
22 // * Redistributions of source code must retain the above copyright
23 // notice, this list of conditions and the following disclaimer.
24 //
25 // * Redistributions in binary form must reproduce the above copyright
26 // notice, this list of conditions and the following disclaimer in the
27 // documentation and/or other materials provided with the distribution.
28 //
29 // * Neither the name of Rice University (RICE) nor the names of its
30 // contributors may be used to endorse or promote products derived from
31 // this software without specific prior written permission.
32 //
33 // This software is provided by RICE and contributors "as is" and any
34 // express or implied warranties, including, but not limited to, the
35 // implied warranties of merchantability and fitness for a particular
36 // purpose are disclaimed. In no event shall RICE or contributors be
37 // liable for any direct, indirect, incidental, special, exemplary, or
38 // consequential damages (including, but not limited to, procurement of
39 // substitute goods or services; loss of use, data, or profits; or
40 // business interruption) however caused and on any theory of liability,
41 // whether in contract, strict liability, or tort (including negligence
42 // or otherwise) arising in any way out of the use of this software, even
43 // if advised of the possibility of such damage.
44 //
45 // ******************************************************* EndRiceCopyright *
46 
47 //************************* System Include Files ****************************
48 
49 #include <stdbool.h>
50 #include <stdlib.h>
51 
52 #include <assert.h>
53 
54 //*************************** User Include Files ****************************
55 
56 #include "monitor.h"
57 #include "metrics.h"
58 
59 #include <memory/hpcrun-malloc.h>
60 
61 #include <messages/messages.h>
62 
63 #include <cct/cct.h>
64 
65 #include <lib/prof-lean/hpcio.h>
66 #include <lib/prof-lean/hpcfmt.h>
68 
69 
70 //*************************** Constants ***************************
71 
72 #define OPERATION_ASSIGN '='
73 #define OPERATION_INCREMENT '+'
74 #define OPERATION_MIN '<'
75 #define OPERATION_MAX '>'
76 
77 
78 //*************************** Concrete Data Types ***************************
79 
80 //
81 // following typedef accomplishes
82 // metric_set_t* == array of metric values, but it does this abstractly
83 // so that clients of the metric datatype must use the interface.
84 //
85 struct metric_set_t {
87 };
88 
89 //*************************** Local Data **************************
90 
91 // number of metrics requested
92 static int n_metrics = 0;
93 
94 // Dense array holding "0" values for nodes with no metrics
96 
97 // information about tracked metrics
99 
100 // flag to indicate that metric allocation is finalized
101 static bool has_set_max_metrics = false;
102 
103 // some sample sources will pre-allocate some metrics ...
105 
106 // need an index-->metric desc mapping, so that samples will increment metrics correctly
108 
109 // local metric_tbl serves 2 purposes:
110 // 1) mapping from metric_id ==> metric desc, so that samples will increment correct metric slot
111 // in the cct node
112 // 2) metric info is written out in metric_tbl form
113 //
114 static metric_desc_p_tbl_t metric_tbl;
115 
116 //
117 // To accomodate block sparse representation,
118 // use 'kinds' == dense subarrays of metrics
119 //
120 // Sample use:
121 // Std metrics = 1 class,
122 // CUDA metrics = another class
123 //
124 // To use the mechanism, call hpcrun_metrics_new_kind.
125 // Then each call to hpcrun_new_metric will yield a slot in the
126 // new metric kind subarray.
127 //
128 // For complicated metric assignment, hpcrun_metrics_switch_kind(kind),
129 // and hpcrun_new_metric_of_kind(kind) enable fine-grain control
130 // of metric sloc allocation
131 //
132 // Default case is 1 kind.
133 //
134 // Future expansion to permit different strategies is possible, but
135 // unimplemented at this time
136 
137 struct kind_info_t {
138  int idx; // current index in kind
139  kind_info_t* link; // all kinds linked together in singly linked list
140 };
141 
142 static kind_info_t kinds = {.idx = 0, .link = NULL };
145 
148 {
150  *rv = (kind_info_t) {.idx = 0, .link = NULL};
151  current_insert->link = rv;
152  current_insert = rv;
153  current_kind = rv;
154  return rv;
155 }
156 
157 void
159 {
160  current_kind = kind;
161 }
162 
163 //
164 // local table of metric update functions
165 // (indexed by metric id)
166 //
167 
169 
171 
172 
173 //***************************************************************************
174 // Local functions
175 //***************************************************************************
176 
177 
178 //***************************************************************************
179 // Interface functions
180 //***************************************************************************
181 
182 bool
184 {
185  return has_set_max_metrics;
186 }
187 
188 
189 void
191 {
192  if (has_set_max_metrics) {
193  return;
194  }
195  for(int i=0; i < num; i++){
197  n->next = pre_alloc;
198  pre_alloc = n;
199  }
200  // NOTE: actual metric count not incremented until a new metric is requested
201 }
202 
203 
204 //
205 // first call to get_num_metrics will finalize
206 // the metric info table
207 //
208 int
210 {
211  //
212  // create id->descriptor table, metric_tbl, and metric_proc tbl
213  //
214  if (!has_set_max_metrics) {
215  id2metric = hpcrun_malloc(n_metrics * sizeof(metric_desc_t*));
216  metric_tbl.len = n_metrics;
217  metric_tbl.lst = id2metric;
218  for(metric_list_t* l = metric_data; l; l = l->next){
219  TMSG(METRICS_FINALIZE,"metric_tbl[%d] = %s", l->id, l->val.name);
220  id2metric[l->id] = &(l->val);
221  }
223 
224  for(metric_proc_map_t* l = proc_map; l; l = l->next) {
225  // for(metric_proc_map_t* l = proc_map; l; l = l->next) {
226  TMSG(METRICS_FINALIZE, "metric_proc[%d] = %p", l->id, l->proc);
227  metric_proc_tbl[l->id] = l->proc;
228  }
229  // *** TEMPORARY ***
230  // *** create a "NULL METRICS" dense array for use with
231  // *** metric set dense copy
232 
233  null_metrics = (hpcrun_metricVal_t*) hpcrun_metric_set_new();
234  for (int i = 0; i < n_metrics; i++) {
235  null_metrics[i].bits = 0;
236  }
237  }
238  has_set_max_metrics = true;
239 
240  return n_metrics;
241 }
242 
243 // Finalize metrics
244 
246 {
248 }
249 
251 hpcrun_id2metric(int metric_id)
252 {
254  if ((0 <= metric_id) && (metric_id < n_metrics)) {
255  return id2metric[metric_id];
256  }
257  return NULL;
258 }
259 
260 
261 metric_desc_p_tbl_t*
263 {
264  hpcrun_get_num_metrics(); // make sure metric table finalized
265  // in case of no samples
266  return &metric_tbl;
267 }
268 
269 
272 {
273  return metric_data;
274 }
275 
276 
277 // *** FIXME? metric finalization may not be necessary
278 // when metric set repr changes
279 //
282 {
283  hpcrun_get_num_metrics(); // ensure that metrics are finalized
284 
285  if ((0 <= metric_id) && (metric_id < n_metrics)) {
286  return metric_proc_tbl[metric_id];
287  }
288 
289  return NULL;
290 }
291 
292 //
293 // Allocate new metric of a particular kind
294 //
295 int
297 {
298  if (has_set_max_metrics) {
299  return 0;
300  }
301 
302  metric_list_t* n = NULL;
303 
304  // if there are pre-allocated metrics, use them
305  if (pre_alloc) {
306  n = pre_alloc;
307  pre_alloc = pre_alloc->next;
308  }
309  else {
310  n = (metric_list_t*) hpcrun_malloc(sizeof(metric_list_t));
311  }
312  n->next = metric_data;
313  n->id = n_metrics;
314  metric_data = n;
315 
316  kind->idx++;
317 
318  n_metrics++;
319 
320  //
321  // No preallocation for metric_proc tbl
322  //
324  m->next = proc_map;
325  m->id = metric_data->id;
326  m->proc = (metric_upd_proc_t*) NULL;
327  proc_map = m;
328 
329  return metric_data->id;
330 }
331 
332 int
334 {
335  return hpcrun_new_metric_of_kind(current_kind);
336 }
337 
339 hpcrun_set_metric_info_w_fn(int metric_id, const char* name,
340  MetricFlags_ValFmt_t valFmt, size_t period,
342 {
343  if (has_set_max_metrics) {
344  return NULL;
345  }
346 
347  metric_desc_t* mdesc = NULL;
348  for (metric_list_t* l = metric_data; l; l = l->next) {
349  if (l->id == metric_id) {
350  mdesc = &(l->val);
351  break;
352  }
353  }
354  TMSG(METRICS,"id = %d, name = %s, flags = %d, period = %d", metric_id, name, valFmt, period);
355  if (! mdesc) {
356  EMSG("Metric id is NULL (likely unallocated)");
358  }
359  if (name == NULL) {
360  EMSG("Must supply a name for metric");
362  }
363 
364  *mdesc = metricDesc_NULL;
366 
367  mdesc->name = (char*) name;
368  mdesc->description = (char*) name; // TODO
369  mdesc->period = period;
370  mdesc->flags.fields.ty = MetricFlags_Ty_Raw; // FIXME
371  mdesc->flags.fields.valFmt = valFmt;
372  mdesc->formula = NULL;
373  mdesc->format = NULL;
374  mdesc->properties = prop;
375 
376  //
377  // manage metric proc mapping
378  //
379  for (metric_proc_map_t* l = proc_map; l; l = l->next){
380  if (l->id == metric_id){
381  l->proc = upd_fn;
382  break;
383  }
384  }
385  return mdesc;
386 }
387 
388 
389 /****
390  * create a metric with more options to tune attributes like
391  * show and show_percent
392  *
393  * This method is mainly used by datacentric which requires helper metrics
394  * to store information but not to be consumed by users.
395  ***/
397 hpcrun_set_metric_and_attributes(int metric_id, const char* name,
399  uint8_t show, uint8_t show_percent)
400 {
401  metric_desc_t* metric = hpcrun_set_metric_info_w_fn(metric_id, name, valFmt, period,
402  hpcrun_metric_std_inc, prop);
403 
404  metric->flags.fields.show = show;
405  metric->flags.fields.showPercent = show_percent;
406 
407  return metric;
408 }
409 
411 hpcrun_set_metric_info_and_period(int metric_id, const char* name,
413 {
414  return hpcrun_set_metric_info_w_fn(metric_id, name, valFmt, period,
415  hpcrun_metric_std_inc, prop);
416 }
417 
418 
419 //
420 // utility routine to make an Async metric with period 1
421 //
423 hpcrun_set_metric_info(int metric_id, const char* name)
424 {
425  return hpcrun_set_metric_info_and_period(metric_id, name,
427 }
428 
429 
430 //
431 // hpcrun_set_metric_name function is primarily used by
432 // synchronous sample sources that need to name the metrics
433 // after they have been allocated.
434 //
435 // makes a call to hpcrun_get_num_metrics just to ensure that
436 // metric_tbl has been finalized.
437 //
438 void
439 hpcrun_set_metric_name(int metric_id, char* name)
440 {
442 
443  if ((0 <= metric_id) && (metric_id < n_metrics)) {
444  id2metric[metric_id]->name = name;
445  id2metric[metric_id]->description = name;
446  }
447 }
448 
449 //
450 // Metric set interface
451 //
452 
453 
454 
457 {
458  return hpcrun_malloc(n_metrics * sizeof(hpcrun_metricVal_t));
459 }
460 
461 //
462 // return an lvalue from metric_set_t*
463 //
466 {
467  if (s && (0 <= id) && (id < n_metrics)) {
468  return &(s->v1) + id;
469  }
470  return NULL;
471 }
472 
473 
474 void
475 hpcrun_metric_std(int metric_id, metric_set_t* set,
476  char operation, hpcrun_metricVal_t val)
477 {
478  metric_desc_t* minfo = hpcrun_id2metric(metric_id);
479  if (!minfo) {
480  return;
481  }
482 
483  hpcrun_metricVal_t* loc = hpcrun_metric_set_loc(set, metric_id);
484 
485  switch (minfo->flags.fields.valFmt) {
487  if (operation == OPERATION_INCREMENT)
488  loc->i += val.i;
489  else if (operation == OPERATION_ASSIGN)
490  loc->i = val.i;
491  break;
492 
494  if (operation == OPERATION_INCREMENT)
495  loc->r += val.r;
496  else if (operation == OPERATION_ASSIGN)
497  loc->r = val.r;
498  break;
499 
501  if (operation == OPERATION_MIN) {
502  if ( (loc->p && loc->p > val.p) ||
503  loc->p == NULL) {
504  loc->p = val.p;
505  }
506  }
507  else if (operation == OPERATION_MAX) {
508  if (loc->p < val.p) {
509  loc->p = val.p;
510  }
511  }
512  else if (operation == OPERATION_ASSIGN ||
513  operation == OPERATION_INCREMENT)
514  loc->p = val.p;
515  break;
516  default:
517  assert(false);
518  }
519 }
520 
521 //
522 // replace the old value with the new value
523 //
524 void
526  hpcrun_metricVal_t value)
527 {
528  hpcrun_metric_std(metric_id, set, '=', value);
529 }
530 
531 // increasing the value of metric
532 //
533 void
535  hpcrun_metricVal_t incr)
536 {
537  hpcrun_metric_std(metric_id, set, '+', incr);
538 }
539 
540 // set the minimum value (only applicable for address type value)s
541 void
543 {
544  hpcrun_metric_std(metric_id, set, '<', val);
545 }
546 
547 // set the maximum value (only applicable for address type value)
548 void
550 {
551  hpcrun_metric_std(metric_id, set, '>', val);
552 }
553 
554 
555 
556 //
557 // copy a metric set
558 //
559 void
561  metric_set_t* set,
562  int num_metrics)
563 {
564  metric_set_t* actual = set ? set : (metric_set_t*) null_metrics;
565  memcpy((char*) dest, (char*) actual, num_metrics * sizeof(cct_metric_data_t));
566 }
int hpcrun_new_metric_of_kind(kind_info_t *kind)
Definition: metrics.c:296
static metric_upd_proc_t ** metric_proc_tbl
Definition: metrics.c:168
void hpcrun_set_metric_name(int metric_id, char *name)
Definition: metrics.c:439
static struct perf_mem_metric metric
Definition: pmu_x86.c:114
const metric_desc_t metricDesc_NULL
Definition: hpcrun-fmt.c:254
static metric_proc_map_t * proc_map
Definition: metrics.c:170
MetricFlags_Ty_t ty
Definition: hpcrun-fmt.h:261
MetricFlags_ValFmt_t valFmt
Definition: hpcrun-fmt.h:263
#define OPERATION_INCREMENT
Definition: metrics.c:73
void metric_upd_proc_t(int metric_id, metric_set_t *set, cct_metric_data_t datum)
Definition: metrics.h:79
static kind_info_t * current_insert
Definition: metrics.c:144
struct metric_proc_map_t * next
Definition: metrics.h:84
const hpcrun_metricFlags_t hpcrun_metricFlags_NULL
Definition: hpcrun-fmt.c:265
static metric_list_t * pre_alloc
Definition: metrics.c:104
void hpcrun_metric_std_set(int metric_id, metric_set_t *set, hpcrun_metricVal_t value)
Definition: metrics.c:525
int hpcrun_get_num_metrics()
Definition: metrics.c:209
void hpcrun_metric_std_min(int metric_id, metric_set_t *set, hpcrun_metricVal_t val)
Definition: metrics.c:542
static hpcrun_metricVal_t * null_metrics
Definition: metrics.c:95
static metric_desc_t ** id2metric
Definition: metrics.c:107
metric_desc_p_tbl_t * hpcrun_get_metric_tbl()
Definition: metrics.c:262
hpcrun_metricVal_t v1
Definition: metrics.c:86
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)
Definition: metrics.c:411
metric_upd_proc_t * hpcrun_get_metric_proc(int metric_id)
Definition: metrics.c:281
metric_desc_t * hpcrun_set_metric_and_attributes(int metric_id, const char *name, MetricFlags_ValFmt_t valFmt, size_t period, metric_desc_properties_t prop, uint8_t show, uint8_t show_percent)
Definition: metrics.c:397
struct kind_info_t kind_info_t
Definition: metrics.h:112
kind_info_t * hpcrun_metrics_new_kind(void)
Definition: metrics.c:147
char * description
Definition: hpcrun-fmt.h:370
static int n_metrics
Definition: metrics.c:92
struct metric_list_t * next
Definition: hpcrun-fmt.h:388
void hpcrun_metric_std_max(int metric_id, metric_set_t *set, hpcrun_metricVal_t val)
Definition: metrics.c:549
#define OPERATION_ASSIGN
Definition: metrics.c:72
hpcrun_metricFlags_fields fields
Definition: hpcrun-fmt.h:276
#define EMSG
Definition: messages.h:70
char * format
Definition: hpcrun-fmt.h:379
bool hpcrun_metrics_finalized()
Definition: metrics.c:183
static kind_info_t * current_kind
Definition: metrics.c:143
void * hpcrun_malloc(size_t size)
Definition: mem.c:275
uint64_t period
Definition: hpcrun-fmt.h:374
cct_metric_data_t * hpcrun_metric_set_loc(metric_set_t *s, int id)
Definition: metrics.c:465
metric_list_t * hpcrun_get_metric_data()
Definition: metrics.c:271
#define TMSG(f,...)
Definition: messages.h:93
kind_info_t * link
Definition: metrics.c:139
char * formula
Definition: hpcrun-fmt.h:378
#define OPERATION_MAX
Definition: metrics.c:75
static bool has_set_max_metrics
Definition: metrics.c:101
#define NULL
Definition: ElfHelper.cpp:85
void hpcrun_metric_std(int metric_id, metric_set_t *set, char operation, hpcrun_metricVal_t val)
Definition: metrics.c:475
metric_desc_t * hpcrun_set_metric_info_w_fn(int metric_id, const char *name, MetricFlags_ValFmt_t valFmt, size_t period, metric_upd_proc_t upd_fn, metric_desc_properties_t prop)
Definition: metrics.c:339
#define OPERATION_MIN
Definition: metrics.c:74
static kind_info_t kinds
Definition: metrics.c:142
metric_set_t * hpcrun_metric_set_new(void)
Definition: metrics.c:456
int hpcrun_new_metric(void)
Definition: metrics.c:333
metric_desc_t * hpcrun_set_metric_info(int metric_id, const char *name)
Definition: metrics.c:423
metric_upd_proc_t * proc
Definition: metrics.h:85
void hpcrun_finalize_metrics()
Definition: metrics.c:245
<!-- ********************************************************************--> 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 monitor_real_abort(void)
metric_desc_properties_t properties
Definition: hpcrun-fmt.h:376
void hpcrun_pre_allocate_metrics(size_t num)
Definition: metrics.c:190
static metric_desc_p_tbl_t metric_tbl
Definition: metrics.c:114
void hpcrun_metric_std_inc(int metric_id, metric_set_t *set, hpcrun_metricVal_t incr)
Definition: metrics.c:534
hpcrun_metricFlags_t flags
Definition: hpcrun-fmt.h:372
void hpcrun_metrics_switch_kind(kind_info_t *kind)
Definition: metrics.c:158
static metric_list_t * metric_data
Definition: metrics.c:98
MetricFlags_ValFmt_t
Definition: hpcrun-fmt.h:248
metric_desc_t * hpcrun_id2metric(int metric_id)
Definition: metrics.c:251
static long period
Definition: itimer.c:194
#define metric_property_none
Definition: hpcrun-fmt.h:202
void hpcrun_metric_set_dense_copy(cct_metric_data_t *dest, metric_set_t *set, int num_metrics)
Definition: metrics.c:560