HPCToolkit
hpcrun-fmt.h
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 //***************************************************************************
48 //
49 // File:
50 // $HeadURL$
51 //
52 // Purpose:
53 // Low-level types and functions for reading/writing a call path
54 // profile as formatted data.
55 //
56 // See hpcrun-fmt.txt.
57 //
58 // These routines *must not* allocate dynamic memory; if such memory
59 // is needed, callbacks to the user's allocator should be used.
60 //
61 // Description:
62 // [The set of functions, macros, etc. defined in the file]
63 //
64 //***************************************************************************
65 
66 #ifndef prof_lean_hpcrun_fmt_h
67 #define prof_lean_hpcrun_fmt_h
68 
69 //************************* System Include Files ****************************
70 
71 #include <stdbool.h>
72 #include <limits.h>
73 
74 //*************************** User Include Files ****************************
75 
76 #include <include/uint.h>
77 
78 #include "hpcio.h"
79 #include "hpcio-buffer.h"
80 #include "hpcfmt.h"
81 
82 #include "lush/lush-support.h"
83 
84 //*************************** Forward Declarations **************************
85 
86 #if defined(__cplusplus)
87 extern "C" {
88 #endif
89 
90 //***************************************************************************
91 
92 // hpcrun profile filename suffix
93 static const char HPCRUN_ProfileFnmSfx[] = "hpcrun";
94 
95 // hpcrun trace filename suffix
96 static const char HPCRUN_TraceFnmSfx[] = "hpctrace";
97 
98 // hpcrun log filename suffix
99 static const char HPCRUN_LogFnmSfx[] = "log";
100 
101 // hpcprof metric db filename suffix
102 static const char HPCPROF_MetricDBSfx[] = "metric-db";
103 
104 static const char HPCPROF_TmpFnmSfx[] = "tmp";
105 
106 
107 //***************************************************************************
108 // hdr
109 //***************************************************************************
110 
111 // N.B.: The header string is 24 bytes of character data
112 
113 static const char HPCRUN_FMT_Magic[] = "HPCRUN-profile____"; // 18 bytes
114 static const char HPCRUN_FMT_Version[] = "02.00"; // 5 bytes
115 static const char HPCRUN_FMT_Endian[] = "b"; // 1 byte
116 
117 static const int HPCRUN_FMT_MagicLen = (sizeof(HPCRUN_FMT_Magic) - 1);
118 static const int HPCRUN_FMT_VersionLen = (sizeof(HPCRUN_FMT_Version) - 1);
119 static const int HPCRUN_FMT_EndianLen = (sizeof(HPCRUN_FMT_Endian) - 1);
120 
121 
122 // currently supported versions
123 static const double HPCRUN_FMT_Version_20 = 2.0;
124 
125 
126 typedef struct hpcrun_fmt_hdr_t {
127 
129  double version;
130 
131  char endian;
132 
134 
136 
137 
138 extern int
140 
141 extern int
142 hpcrun_fmt_hdr_fwrite(FILE* outfs, ...);
143 
144 extern int
145 hpcrun_fmt_hdr_fprint(hpcrun_fmt_hdr_t* hdr, FILE* outf);
146 
147 extern void
149 
150 
151 // Note: use #defines to (portably) avoid warnings about unused
152 // "static const char*" variables.
153 #define HPCRUN_FMT_NV_prog "program-name"
154 #define HPCRUN_FMT_NV_progPath "program-path"
155 #define HPCRUN_FMT_NV_envPath "env-path"
156 #define HPCRUN_FMT_NV_jobId "job-id"
157 #define HPCRUN_FMT_NV_mpiRank "mpi-rank"
158 #define HPCRUN_FMT_NV_tid "thread-id"
159 #define HPCRUN_FMT_NV_hostid "host-id"
160 #define HPCRUN_FMT_NV_pid "process-id"
161 
162 #define HPCRUN_FMT_NV_traceMinTime "trace-min-time"
163 #define HPCRUN_FMT_NV_traceMaxTime "trace-max-time"
164 
165 
166 //***************************************************************************
167 // epoch-hdr
168 //***************************************************************************
169 
170 static const char HPCRUN_FMT_EpochTag[] = "EPOCH___";
171 static const int HPCRUN_FMT_EpochTagLen = (sizeof(HPCRUN_FMT_EpochTag) - 1);
172 
173 
174 typedef struct epoch_flags_bitfield {
175  bool isLogicalUnwind : 1;
176  uint64_t unused : 63;
178 
179 
180 typedef union epoch_flags_t {
182  uint64_t bits; // for reading/writing
183 } epoch_flags_t;
184 
185 
186 typedef struct hpcrun_fmt_epochHdr_t {
187 
192 
194 
195 typedef struct metric_desc_properties_t {
196  unsigned time:1;
197  unsigned cycles:1;
199 
200 #define metric_property_time ( (metric_desc_properties_t) { .time = 1 } )
201 #define metric_property_cycles ( (metric_desc_properties_t) { .cycles = 1 } )
202 #define metric_property_none ( (metric_desc_properties_t) { } )
203 
204 extern int
207 
208 extern int
210  uint64_t measurementGranularity,
211  ...);
212 
213 extern int
215 
216 extern void
218 
219 
220 //***************************************************************************
221 // metric-tbl
222 //***************************************************************************
223 
224 // --------------------------------------------------------------------------
225 // hpcrun_metricFlags_t
226 // --------------------------------------------------------------------------
227 
228 
229 typedef enum {
230 
235 
237 
238 
239 typedef enum {
240 
244 
246 
247 
248 typedef enum {
249 
254 
256 
257 
258 // N.B. do *not* use sub-byte bit fields since compilers are free to
259 // reorder them within the byte.
261  MetricFlags_Ty_t ty : 8;
262  MetricFlags_ValTy_t valTy : 8;
263  MetricFlags_ValFmt_t valFmt : 8;
264  uint8_t unused0;
265 
266  uint16_t partner;
267  uint8_t /*bool*/ show;
268  uint8_t /*bool*/ showPercent;
269 
270  uint64_t unused1;
272 
273 
274 typedef union hpcrun_metricFlags_t {
275 
277 
278  uint8_t bits[2 * 8]; // for reading/writing
279 
280  uint64_t bits_big[2]; // for easy initialization
281 
283 
284 
285 // FIXME: tallent: temporarily support old non-portable convention
287  MetricFlags_Ty_t ty : 4;
288  MetricFlags_ValTy_t valTy : 4;
289  MetricFlags_ValFmt_t valFmt : 4;
290  uint partner : 16;
291  bool show : 1;
292  bool showPercent : 1;
293 
294  uint64_t unused0 : 34;
295  uint64_t unused1;
297 
298 
299 // FIXME: tallent: temporarily support old non-portable convention
301 
303 
304  uint64_t bits[2]; // for reading/writing
305 
307 
308 
310 
311 
312 #if 0
313 static inline bool
314 hpcrun_metricFlags_isFlag(hpcrun_metricFlags_t flagbits,
316 {
317  return (flagbits & f);
318 }
319 
320 
321 static inline void
322 hpcrun_metricFlags_setFlag(hpcrun_metricFlags_t* flagbits,
324 {
325  *flagbits = (*flagbits | f);
326 }
327 
328 
329 static inline void
330 hpcrun_metricFlags_unsetFlag(hpcrun_metricFlags_t* flagbits,
332 {
333  *flagbits = (*flagbits & ~f);
334 }
335 #endif
336 
337 
338 // --------------------------------------------------------------------------
339 // hpcrun_metricVal_t
340 // --------------------------------------------------------------------------
341 
342 typedef union hpcrun_metricVal_u {
343 
344  uint64_t i; // integral data
345  double r; // real
346  void* p; // address data
347 
348  uint64_t bits; // for reading/writing
349 
351 
353 
354 static inline bool
356 {
357  return (x.bits == hpcrun_metricVal_ZERO.bits);
358 }
359 
360 
361 
362 
363 // --------------------------------------------------------------------------
364 // metric_desc_t
365 // --------------------------------------------------------------------------
366 
367 typedef struct metric_desc_t {
368 
369  char* name;
370  char* description;
371 
373 
374  uint64_t period;
375 
377 
378  char* formula;
379  char* format;
380 
382 } metric_desc_t;
383 
384 extern const metric_desc_t metricDesc_NULL;
385 
386 
387 typedef struct metric_list_t {
390  int id;
391 } metric_list_t;
392 
393 
394 
396 typedef HPCFMT_List(metric_desc_t) metric_tbl_t; // hpcrun_metricTbl_t
397 
399 HPCFMT_List_declare(metric_desc_p_t);
400 typedef HPCFMT_List(metric_desc_p_t) metric_desc_p_tbl_t; // HPCFMT_List of metric_desc_t*
401 
402 extern int
403 hpcrun_fmt_metricTbl_fread(metric_tbl_t* metric_tbl, metric_aux_info_t **aux_info, FILE* in,
404  double fmtVersion, hpcfmt_alloc_fn alloc);
405 
406 extern int
407 hpcrun_fmt_metricTbl_fwrite(metric_desc_p_tbl_t* metric_tbl, metric_aux_info_t *aux_info, FILE* out);
408 
409 extern int
410 hpcrun_fmt_metricTbl_fprint(metric_tbl_t* metrics, metric_aux_info_t *aux_info, FILE* out);
411 
412 extern void
413 hpcrun_fmt_metricTbl_free(metric_tbl_t* metric_tbl, hpcfmt_free_fn dealloc);
414 
415 
416 extern int
418  double fmtVersion, hpcfmt_alloc_fn alloc);
419 
420 extern int
422 
423 extern int
424 hpcrun_fmt_metricDesc_fprint(metric_desc_t* x, metric_aux_info_t *aux_info, FILE* outfs, const char* pre);
425 
426 extern void
428 
429 // ---------------------------------------------------------
430 // metric get and set
431 // ---------------------------------------------------------
432 
433 double
435 
436 void
438  hpcrun_metricVal_t *metric, double value);
439 
440 void
442  hpcrun_metricVal_t *metric, int value);
443 
444 void
446  hpcrun_metricVal_t *metric, double value);
447 
448 //***************************************************************************
449 // loadmap
450 //***************************************************************************
451 
452 typedef struct loadmap_entry_t {
453 
454  uint16_t id; // HPCRUN_FMT_LMId_NULL is the NULL value
455  char* name;
456  uint64_t flags;
457 
459 
460 
462 typedef HPCFMT_List(loadmap_entry_t) loadmap_t; // hpcrun_loadmap_t
463 
464 
465 extern int
466 hpcrun_fmt_loadmap_fread(loadmap_t* loadmap, FILE* infs, hpcfmt_alloc_fn alloc);
467 
468 extern int
469 hpcrun_fmt_loadmap_fwrite(loadmap_t* loadmap, FILE* outfs);
470 
471 extern int
472 hpcrun_fmt_loadmap_fprint(loadmap_t* loadmap, FILE* outfs);
473 
474 extern void
475 hpcrun_fmt_loadmap_free(loadmap_t* loadmap, hpcfmt_free_fn dealloc);
476 
477 
478 extern int
481 
482 extern int
484 
485 extern int
487  const char* pre);
488 
489 extern void
491 
492 
493 //***************************************************************************
494 // cct
495 //***************************************************************************
496 
497 #define HPCRUN_FMT_CCTNodeId_NULL (0)
498 
499 #define HPCRUN_FMT_RetainIdFlag (0x1)
500 
501 static inline bool
503 {
504  return (id & HPCRUN_FMT_RetainIdFlag);
505 }
506 
507 
508 // --------------------------------------------------------------------------
509 // hpcrun_fmt_cct_node_t
510 // --------------------------------------------------------------------------
511 
512 //
513 // hpcrun node types
514 //
515 #define NODE_TYPE_REGULAR 0
516 #define NODE_TYPE_LEAF 1
517 #define NODE_TYPE_ALLOCATION 2
518 #define NODE_TYPE_GLOBAL_VARIABLE 4
519 #define NODE_TYPE_MEMACCESS 8
520 #define NODE_TYPE_ROOT 16
521 
522 
523 #define HPCRUN_FMT_LMId_NULL (0)
524 
525 #define HPCRUN_FMT_LMIp_NULL (0)
526 #define HPCRUN_FMT_LMIp_Flag1 (1)
527 
528 // Primary syntethic root: <lm-id: NULL, lm-ip: NULL>
529 // Secondary synthetic root: <lm-id: NULL, lm-ip: Flag1>
530 
531 
532 // -------------------------
533 // data-centric fields
534 // -------------------------
535 
536 
537 typedef struct hpcrun_fmt_cct_node_t {
538 
539  uint16_t node_type; // see hpcrun node type above
540 
541  // id and parent id. 0 is reserved as a NULL value
542  uint32_t id;
543  uint32_t id_parent;
544 
546 
547  // load module id. Use HPCRUN_FMT_LMId_NULL as a NULL value.
548  uint16_t lm_id;
549 
550  // static instruction pointer: more accurately, this is a static
551  // 'operation pointer'. The operation in the instruction packet is
552  // represented by adding 0, 1, or 2 to the instruction pointer for
553  // the first, second and third operation, respectively.
555 
556  // static logical instruction pointer
558 
561 
563 
564 
565 static inline void
567 {
568  memset(x, 0, sizeof(*x));
569 }
570 
571 
572 // N.B.: assumes space for metrics has been allocated
573 extern int
575  epoch_flags_t flags, FILE* fs);
576 
577 extern int
579  epoch_flags_t flags, FILE* fs);
580 
581 extern int
583  epoch_flags_t flags, const metric_tbl_t* metricTbl,
584  const char* pre);
585 
586 static inline bool
588 {
589  return (type & NODE_TYPE_ROOT) == NODE_TYPE_ROOT;
590 }
591 
592 static inline bool
594 {
595  return (type & NODE_TYPE_ALLOCATION) == NODE_TYPE_ALLOCATION;
596 }
597 
598 
599 // --------------------------------------------------------------------------
600 //
601 // --------------------------------------------------------------------------
602 
603 extern int
604 hpcrun_fmt_lip_fread(lush_lip_t* x, FILE* fs);
605 
606 extern int
607 hpcrun_fmt_lip_fwrite(lush_lip_t* x, FILE* fs);
608 
609 extern int
610 hpcrun_fmt_lip_fprint(lush_lip_t* x, FILE* fs, const char* pre);
611 
612 
613 //***************************************************************************
614 // hpctrace (located here for now)
615 //***************************************************************************
616 
617 //***************************************************************************
618 // [hpctrace] hdr
619 //***************************************************************************
620 
621 // Header sizes:
622 // - version 1.00: 24 bytes
623 // - version 1.01: 32 bytes: 24 + sizeof(hpctrace_hdr_flags_t)
624 
625 static const char HPCTRACE_FMT_Magic[] = "HPCRUN-trace______"; // 18 bytes
626 static const char HPCTRACE_FMT_Version[] = "01.01"; // 5 bytes
627 static const char HPCTRACE_FMT_Endian[] = "b"; // 1 byte
628 
629 
631  bool isDataCentric : 1;
632  uint64_t unused : 63;
634 
635 
636 typedef union hpctrace_hdr_flags_t {
638  uint64_t bits; // for reading/writing
640 
642 
643 
644 #define HPCTRACE_FMT_MagicLenX (sizeof(HPCTRACE_FMT_Magic) - 1)
645 #define HPCTRACE_FMT_VersionLenX (sizeof(HPCTRACE_FMT_Version) - 1)
646 #define HPCTRACE_FMT_EndianLenX (sizeof(HPCTRACE_FMT_Endian) - 1)
647 #define HPCTRACE_FMT_FlagsLenX (sizeof(hpctrace_hdr_flags_t))
648 
653 
654 static const int HPCTRACE_FMT_HeaderLen =
659 
660 
661 typedef struct hpctrace_fmt_hdr_t {
662 
664  double version;
665 
666  char endian;
667 
669 
671 
672 
673 int
675 
676 int
678 
679 // N.B.: not async safe
680 int
682 
683 int
685 
686 
687 //***************************************************************************
688 // [hpctrace] trace record/datum
689 //***************************************************************************
690 
691 #define HPCRUN_FMT_MetricId_NULL (INT_MAX) // for Java, no UINT32_MAX
692 
693 typedef struct hpctrace_fmt_datum_t {
694  uint64_t time; // microseconds
695  uint32_t cpId; // call path id (CCT leaf id); cf. HPCRUN_FMT_CCTNodeId_NULL
696  uint32_t metricId;
698 
699 
700 int
702  FILE* fs);
703 
704 int
706  hpcio_outbuf_t* outbuf);
707 
708 // N.B.: not async safe
709 int
711  FILE* outfs);
712 
713 int
715  FILE* fs);
716 
717 
718 //***************************************************************************
719 // hpcprof-metricdb (located here for now)
720 //***************************************************************************
721 
722 //***************************************************************************
723 // [hpcprof-metricdb] hdr
724 //***************************************************************************
725 
726 static const char HPCMETRICDB_FMT_Magic[] = "HPCPROF-metricdb__"; // 18 bytes
727 static const char HPCMETRICDB_FMT_Version[] = "00.10"; // 5 bytes
728 static const char HPCMETRICDB_FMT_Endian[] = "b"; // 1 byte
729 
730 #define HPCMETRICDB_FMT_MagicLenX (sizeof(HPCMETRICDB_FMT_Magic) - 1)
731 #define HPCMETRICDB_FMT_VersionLenX (sizeof(HPCMETRICDB_FMT_Version) - 1)
732 #define HPCMETRICDB_FMT_EndianLenX (sizeof(HPCMETRICDB_FMT_Endian) - 1)
733 
737 
738 static const int HPCMETRICDB_FMT_HeaderLen =
741 
742 
743 
744 typedef struct hpcmetricDB_fmt_hdr_t {
745 
747  double version;
748  char endian;
749 
750  uint32_t numNodes;
751  uint32_t numMetrics;
752 
754 
755 
756 int
758 
759 int
761 
762 int
764 
765 
766 //***************************************************************************
767 
768 #if defined(__cplusplus)
769 } /* extern "C" */
770 #endif
771 
772 #endif /* prof_lean_hpcrun_fmt_h */
773 
struct hpcrun_metricFlags_bitfield_XXX hpcrun_metricFlags_bitfield_XXX
bool is_frequency_metric
Definition: hpcrun-fmt.h:381
static const char HPCRUN_FMT_Magic[]
Definition: hpcrun-fmt.h:113
int hpcrun_fmt_epochHdr_fwrite(FILE *out, epoch_flags_t flags, uint64_t measurementGranularity,...)
Definition: hpcrun-fmt.c:201
static const int HPCMETRICDB_FMT_MagicLen
Definition: hpcrun-fmt.h:734
HPCFMT_List_declare(metric_desc_t)
static const int HPCTRACE_FMT_MagicLen
Definition: hpcrun-fmt.h:649
int hpcrun_fmt_hdr_fwrite(FILE *outfs,...)
Definition: hpcrun-fmt.c:126
double hpcrun_fmt_metric_get_value(metric_desc_t metric_desc, hpcrun_metricVal_t metric)
Definition: hpcrun-fmt.c:464
static struct perf_mem_metric metric
Definition: pmu_x86.c:114
static const char HPCTRACE_FMT_Version[]
Definition: hpcrun-fmt.h:626
struct metric_desc_properties_t metric_desc_properties_t
MetricFlags_ValFmt_t valFmt
Definition: hpcrun-fmt.h:289
int hpcrun_fmt_metricTbl_fprint(metric_tbl_t *metrics, metric_aux_info_t *aux_info, FILE *out)
Definition: hpcrun-fmt.c:334
int hpcrun_fmt_metricDesc_fread(metric_desc_t *x, metric_aux_info_t *aux_info, FILE *infs, double fmtVersion, hpcfmt_alloc_fn alloc)
#define HPCMETRICDB_FMT_MagicLenX
Definition: hpcrun-fmt.h:730
int hpcmetricDB_fmt_hdr_fprint(hpcmetricDB_fmt_hdr_t *hdr, FILE *outfs)
Definition: hpcrun-fmt.c:1057
hpcrun_metricVal_t hpcrun_metricVal_ZERO
Definition: hpcrun-fmt.c:278
hpcfmt_vma_t lm_ip
Definition: hpcrun-fmt.h:554
void hpcfmt_free_fn(void *mem)
Definition: hpcfmt.h:137
static bool hpcrun_fmt_doRetainId(uint32_t id)
Definition: hpcrun-fmt.h:502
MetricFlags_Ty_t ty
Definition: hpcrun-fmt.h:261
MetricFlags_ValTy_t valTy
Definition: hpcrun-fmt.h:262
static const int HPCMETRICDB_FMT_VersionLen
Definition: hpcrun-fmt.h:735
#define HPCTRACE_FMT_VersionLenX
Definition: hpcrun-fmt.h:645
MetricFlags_ValFmt_t valFmt
Definition: hpcrun-fmt.h:263
void hpcrun_fmt_metric_set_value_int(hpcrun_metricFlags_t *flags, hpcrun_metricVal_t *metric, int value)
Definition: hpcrun-fmt.c:501
struct hpctrace_fmt_datum_t hpctrace_fmt_datum_t
#define HPCRUN_FMT_RetainIdFlag
Definition: hpcrun-fmt.h:499
int hpcrun_fmt_loadmapEntry_fprint(loadmap_entry_t *x, FILE *outfs, const char *pre)
Definition: hpcrun-fmt.c:610
struct loadmap_entry_t loadmap_entry_t
int hpctrace_fmt_hdr_fprint(hpctrace_fmt_hdr_t *hdr, FILE *fs)
Definition: hpcrun-fmt.c:882
int hpctrace_fmt_hdr_fwrite(hpctrace_hdr_flags_t flags, FILE *fs)
Definition: hpcrun-fmt.c:862
const metric_desc_t metricDesc_NULL
Definition: hpcrun-fmt.c:254
static const char HPCRUN_FMT_EpochTag[]
Definition: hpcrun-fmt.h:170
int hpcrun_fmt_hdr_fprint(hpcrun_fmt_hdr_t *hdr, FILE *outf)
Definition: hpcrun-fmt.c:144
uint64_t hpcfmt_vma_t
Definition: hpcfmt.h:102
void hpcrun_fmt_hdr_free(hpcrun_fmt_hdr_t *hdr, hpcfmt_free_fn dealloc)
Definition: hpcrun-fmt.c:159
struct metric_list_t metric_list_t
int hpcrun_fmt_loadmap_fread(loadmap_t *loadmap, FILE *infs, hpcfmt_alloc_fn alloc)
Definition: hpcrun-fmt.c:531
int hpcrun_fmt_loadmapEntry_fread(loadmap_entry_t *x, FILE *infs, hpcfmt_alloc_fn alloc)
Definition: hpcrun-fmt.c:589
#define HPCTRACE_FMT_FlagsLenX
Definition: hpcrun-fmt.h:647
int hpcrun_fmt_loadmap_fprint(loadmap_t *loadmap, FILE *outfs)
Definition: hpcrun-fmt.c:561
int hpcrun_fmt_epochHdr_fprint(hpcrun_fmt_epochHdr_t *ehdr, FILE *out)
Definition: hpcrun-fmt.c:227
static const int HPCRUN_FMT_VersionLen
Definition: hpcrun-fmt.h:118
char versionStr[sizeof(HPCRUN_FMT_Version)]
Definition: hpcrun-fmt.h:128
epoch_flags_t flags
Definition: hpcrun-fmt.h:188
static const char HPCRUN_TraceFnmSfx[]
Definition: hpcrun-fmt.h:96
static const int HPCTRACE_FMT_FlagsLen
Definition: hpcrun-fmt.h:652
struct hpcrun_fmt_cct_node_t hpcrun_fmt_cct_node_t
static const int HPCMETRICDB_FMT_EndianLen
Definition: hpcrun-fmt.h:736
static const int HPCTRACE_FMT_VersionLen
Definition: hpcrun-fmt.h:650
union epoch_flags_t epoch_flags_t
static const char HPCRUN_ProfileFnmSfx[]
Definition: hpcrun-fmt.h:93
int hpcrun_fmt_cct_node_fread(hpcrun_fmt_cct_node_t *x, epoch_flags_t flags, FILE *fs)
Definition: hpcrun-fmt.c:631
metric_desc_t val
Definition: hpcrun-fmt.h:389
uint64_t hpcfmt_uint_t
Definition: hpcfmt.h:103
void hpcrun_fmt_loadmapEntry_free(loadmap_entry_t *x, hpcfmt_free_fn dealloc)
Definition: hpcrun-fmt.c:619
static const char HPCMETRICDB_FMT_Magic[]
Definition: hpcrun-fmt.h:726
static bool hpcrun_fmt_node_type_root(uint16_t type)
Definition: hpcrun-fmt.h:587
hpcfmt_uint_t num_metrics
Definition: hpcrun-fmt.h:559
#define HPCMETRICDB_FMT_VersionLenX
Definition: hpcrun-fmt.h:731
struct metric_desc_t metric_desc_t
char * description
Definition: hpcrun-fmt.h:370
union hpcrun_metricFlags_t hpcrun_metricFlags_t
union hpctrace_hdr_flags_t hpctrace_hdr_flags_t
int hpcrun_fmt_hdr_fread(hpcrun_fmt_hdr_t *hdr, FILE *infs, hpcfmt_alloc_fn alloc)
Definition: hpcrun-fmt.c:93
int hpcmetricDB_fmt_hdr_fread(hpcmetricDB_fmt_hdr_t *hdr, FILE *infs)
Definition: hpcrun-fmt.c:1000
#define NODE_TYPE_ROOT
Definition: hpcrun-fmt.h:520
struct metric_list_t * next
Definition: hpcrun-fmt.h:388
unsigned int uint
Definition: uint.h:124
static const int HPCRUN_FMT_EpochTagLen
Definition: hpcrun-fmt.h:171
struct hpcrun_fmt_hdr_t hpcrun_fmt_hdr_t
void hpcrun_fmt_metricTbl_free(metric_tbl_t *metric_tbl, hpcfmt_free_fn dealloc)
Definition: hpcrun-fmt.c:348
int hpcmetricDB_fmt_hdr_fwrite(hpcmetricDB_fmt_hdr_t *hdr, FILE *outfs)
Definition: hpcrun-fmt.c:1036
void hpcrun_fmt_loadmap_free(loadmap_t *loadmap, hpcfmt_free_fn dealloc)
Definition: hpcrun-fmt.c:575
int hpcrun_fmt_lip_fprint(lush_lip_t *x, FILE *fs, const char *pre)
Definition: hpcrun-fmt.c:770
hpcrun_metricFlags_fields fields
Definition: hpcrun-fmt.h:276
uint16_t id
Definition: hpcrun-fmt.h:454
void hpcrun_fmt_metric_set_value(metric_desc_t metric_desc, hpcrun_metricVal_t *metric, double value)
Definition: hpcrun-fmt.c:482
struct hpcrun_fmt_epochHdr_t hpcrun_fmt_epochHdr_t
const hpcrun_metricFlags_t hpcrun_metricFlags_NULL
Definition: hpcrun-fmt.c:265
char * format
Definition: hpcrun-fmt.h:379
int hpcrun_fmt_loadmapEntry_fwrite(loadmap_entry_t *x, FILE *outfs)
Definition: hpcrun-fmt.c:600
Definition: hpcrun-fmt.h:452
static void hpcrun_fmt_cct_node_init(hpcrun_fmt_cct_node_t *x)
Definition: hpcrun-fmt.h:566
lush_assoc_info_t as_info
Definition: hpcrun-fmt.h:545
static const int HPCTRACE_FMT_EndianLen
Definition: hpcrun-fmt.h:651
int hpcrun_fmt_lip_fwrite(lush_lip_t *x, FILE *fs)
Definition: hpcrun-fmt.c:759
union hpcrun_metricVal_u hpcrun_metricVal_t
static const int HPCRUN_FMT_MagicLen
Definition: hpcrun-fmt.h:117
int hpctrace_fmt_datum_outbuf(hpctrace_fmt_datum_t *x, hpctrace_hdr_flags_t flags, hpcio_outbuf_t *outbuf)
Definition: hpcrun-fmt.c:927
uint32_t raToCallsiteOfst
Definition: hpcrun-fmt.h:190
int hpcrun_fmt_cct_node_fwrite(hpcrun_fmt_cct_node_t *x, epoch_flags_t flags, FILE *fs)
Definition: hpcrun-fmt.c:660
static const char HPCRUN_LogFnmSfx[]
Definition: hpcrun-fmt.h:99
int hpcrun_fmt_metricTbl_fread(metric_tbl_t *metric_tbl, metric_aux_info_t **aux_info, FILE *in, double fmtVersion, hpcfmt_alloc_fn alloc)
Definition: hpcrun-fmt.c:283
epoch_flags_bitfield fields
Definition: hpcrun-fmt.h:181
HPCFMT_List(hpcfmt_nvpair_t) nvps
int hpctrace_fmt_datum_fread(hpctrace_fmt_datum_t *x, hpctrace_hdr_flags_t flags, FILE *fs)
Definition: hpcrun-fmt.c:901
uint64_t flags
Definition: hpcrun-fmt.h:456
uint64_t period
Definition: hpcrun-fmt.h:374
static const char HPCMETRICDB_FMT_Endian[]
Definition: hpcrun-fmt.h:728
int hpctrace_fmt_datum_fprint(hpctrace_fmt_datum_t *x, hpctrace_hdr_flags_t flags, FILE *fs)
Definition: hpcrun-fmt.c:979
static const int HPCRUN_FMT_EndianLen
Definition: hpcrun-fmt.h:119
MetricFlags_ValTy_t
Definition: hpcrun-fmt.h:239
union hpcrun_metricFlags_XXX_t hpcrun_metricFlags_XXX_t
static const char HPCPROF_TmpFnmSfx[]
Definition: hpcrun-fmt.h:104
#define HPCMETRICDB_FMT_EndianLenX
Definition: hpcrun-fmt.h:732
int hpcrun_fmt_epochHdr_fread(hpcrun_fmt_epochHdr_t *ehdr, FILE *fs, hpcfmt_alloc_fn alloc)
Definition: hpcrun-fmt.c:172
struct hpctrace_fmt_hdr_t hpctrace_fmt_hdr_t
uint64_t measurementGranularity
Definition: hpcrun-fmt.h:189
mem_alloc alloc
hpctrace_hdr_flags_bitfield fields
Definition: hpcrun-fmt.h:637
int hpcrun_fmt_metricDesc_fwrite(metric_desc_t *x, metric_aux_info_t *aux_info, FILE *outfs)
Definition: hpcrun-fmt.c:412
char * formula
Definition: hpcrun-fmt.h:378
hpcrun_metricFlags_bitfield_XXX fields
Definition: hpcrun-fmt.h:302
hpctrace_hdr_flags_t flags
Definition: hpcrun-fmt.h:668
uint64_t bits
Definition: hpcrun-fmt.h:182
int hpcrun_fmt_loadmap_fwrite(loadmap_t *loadmap, FILE *outfs)
Definition: hpcrun-fmt.c:548
static bool hpcrun_fmt_node_type_allocation(uint16_t type)
Definition: hpcrun-fmt.h:593
void * hpcfmt_alloc_fn(size_t nbytes)
Definition: hpcfmt.h:133
struct epoch_flags_bitfield epoch_flags_bitfield
static const char HPCPROF_MetricDBSfx[]
Definition: hpcrun-fmt.h:102
int metrics[MAX_EVENTS][MAX_METRICS]
Definition: generic.c:147
const hpctrace_hdr_flags_t hpctrace_hdr_flags_NULL
Definition: hpcrun-fmt.c:789
static const double HPCRUN_FMT_Version_20
Definition: hpcrun-fmt.h:123
int hpcrun_fmt_lip_fread(lush_lip_t *x, FILE *fs)
Definition: hpcrun-fmt.c:748
static const char HPCMETRICDB_FMT_Version[]
Definition: hpcrun-fmt.h:727
static bool hpcrun_metricVal_isZero(hpcrun_metricVal_t x)
Definition: hpcrun-fmt.h:355
void hpcrun_fmt_metricDesc_free(metric_desc_t *x, hpcfmt_free_fn dealloc)
Definition: hpcrun-fmt.c:451
int hpcrun_fmt_cct_node_fprint(hpcrun_fmt_cct_node_t *x, FILE *fs, epoch_flags_t flags, const metric_tbl_t *metricTbl, const char *pre)
Definition: hpcrun-fmt.c:688
struct hpcrun_metricFlags_fields hpcrun_metricFlags_fields
static const char HPCTRACE_FMT_Magic[]
Definition: hpcrun-fmt.h:625
struct hpcmetricDB_fmt_hdr_t hpcmetricDB_fmt_hdr_t
#define HPCTRACE_FMT_MagicLenX
Definition: hpcrun-fmt.h:644
metric_desc_t * metric_desc_p_t
Definition: hpcrun-fmt.h:398
void hpcrun_fmt_epochHdr_free(hpcrun_fmt_epochHdr_t *ehdr, hpcfmt_free_fn dealloc)
Definition: hpcrun-fmt.c:242
int hpctrace_fmt_hdr_fread(hpctrace_fmt_hdr_t *hdr, FILE *infs)
Definition: hpcrun-fmt.c:795
static const char HPCTRACE_FMT_Endian[]
Definition: hpcrun-fmt.h:627
static const int HPCTRACE_FMT_HeaderLen
Definition: hpcrun-fmt.h:654
MetricFlags_ValTy_t valTy
Definition: hpcrun-fmt.h:288
int hpcrun_fmt_metricTbl_fwrite(metric_desc_p_tbl_t *metric_tbl, metric_aux_info_t *aux_info, FILE *out)
Definition: hpcrun-fmt.c:307
#define HPCTRACE_FMT_EndianLenX
Definition: hpcrun-fmt.h:646
char * name
Definition: hpcrun-fmt.h:455
static const char HPCRUN_FMT_Version[]
Definition: hpcrun-fmt.h:114
metric_desc_properties_t properties
Definition: hpcrun-fmt.h:376
#define NODE_TYPE_ALLOCATION
Definition: hpcrun-fmt.h:517
MetricFlags_Ty_t
Definition: hpcrun-fmt.h:229
static metric_desc_p_tbl_t metric_tbl
Definition: metrics.c:114
struct hpctrace_hdr_flags_bitfield hpctrace_hdr_flags_bitfield
hpcrun_metricFlags_t flags
Definition: hpcrun-fmt.h:372
static const int HPCMETRICDB_FMT_HeaderLen
Definition: hpcrun-fmt.h:738
void hpcrun_fmt_metric_set_value_real(hpcrun_metricFlags_t *flags, hpcrun_metricVal_t *metric, double value)
Definition: hpcrun-fmt.c:511
hpcrun_metricVal_t * metrics
Definition: hpcrun-fmt.h:560
int hpctrace_fmt_datum_fwrite(hpctrace_fmt_datum_t *x, hpctrace_hdr_flags_t flags, FILE *outfs)
Definition: hpcrun-fmt.c:965
static const char HPCRUN_FMT_Endian[]
Definition: hpcrun-fmt.h:115
int hpctrace_fmt_hdr_outbuf(hpctrace_hdr_flags_t flags, hpcio_outbuf_t *outbuf)
Definition: hpcrun-fmt.c:833
MetricFlags_ValFmt_t
Definition: hpcrun-fmt.h:248
int hpcrun_fmt_metricDesc_fprint(metric_desc_t *x, metric_aux_info_t *aux_info, FILE *outfs, const char *pre)
Definition: hpcrun-fmt.c:432