66 #ifndef prof_lean_hpcrun_fmt_h 67 #define prof_lean_hpcrun_fmt_h 86 #if defined(__cplusplus) 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" 162 #define HPCRUN_FMT_NV_traceMinTime "trace-min-time" 163 #define HPCRUN_FMT_NV_traceMaxTime "trace-max-time" 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) { } ) 210 uint64_t measurementGranularity,
261 MetricFlags_Ty_t
ty : 8;
280 uint64_t bits_big[2];
287 MetricFlags_Ty_t
ty : 4;
317 return (flagbits & f);
325 *flagbits = (*flagbits | f);
333 *flagbits = (*flagbits & ~f);
357 return (x.
bits == hpcrun_metricVal_ZERO.
bits);
400 typedef HPCFMT_List(metric_desc_p_t) metric_desc_p_tbl_t;
497 #define HPCRUN_FMT_CCTNodeId_NULL (0) 499 #define HPCRUN_FMT_RetainIdFlag (0x1) 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 523 #define HPCRUN_FMT_LMId_NULL (0) 525 #define HPCRUN_FMT_LMIp_NULL (0) 526 #define HPCRUN_FMT_LMIp_Flag1 (1) 568 memset(x, 0,
sizeof(*x));
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)) 691 #define HPCRUN_FMT_MetricId_NULL (INT_MAX) // for Java, no UINT32_MAX 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) 768 #if defined(__cplusplus)
struct hpcrun_metricFlags_bitfield_XXX hpcrun_metricFlags_bitfield_XXX
static const char HPCRUN_FMT_Magic[]
int hpcrun_fmt_epochHdr_fwrite(FILE *out, epoch_flags_t flags, uint64_t measurementGranularity,...)
static const int HPCMETRICDB_FMT_MagicLen
HPCFMT_List_declare(metric_desc_t)
static const int HPCTRACE_FMT_MagicLen
int hpcrun_fmt_hdr_fwrite(FILE *outfs,...)
double hpcrun_fmt_metric_get_value(metric_desc_t metric_desc, hpcrun_metricVal_t metric)
static struct perf_mem_metric metric
static const char HPCTRACE_FMT_Version[]
struct metric_desc_properties_t metric_desc_properties_t
MetricFlags_ValFmt_t valFmt
int hpcrun_fmt_metricTbl_fprint(metric_tbl_t *metrics, metric_aux_info_t *aux_info, FILE *out)
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
int hpcmetricDB_fmt_hdr_fprint(hpcmetricDB_fmt_hdr_t *hdr, FILE *outfs)
hpcrun_metricVal_t hpcrun_metricVal_ZERO
void hpcfmt_free_fn(void *mem)
static bool hpcrun_fmt_doRetainId(uint32_t id)
MetricFlags_ValTy_t valTy
static const int HPCMETRICDB_FMT_VersionLen
#define HPCTRACE_FMT_VersionLenX
MetricFlags_ValFmt_t valFmt
void hpcrun_fmt_metric_set_value_int(hpcrun_metricFlags_t *flags, hpcrun_metricVal_t *metric, int value)
struct hpctrace_fmt_datum_t hpctrace_fmt_datum_t
#define HPCRUN_FMT_RetainIdFlag
int hpcrun_fmt_loadmapEntry_fprint(loadmap_entry_t *x, FILE *outfs, const char *pre)
struct loadmap_entry_t loadmap_entry_t
int hpctrace_fmt_hdr_fprint(hpctrace_fmt_hdr_t *hdr, FILE *fs)
int hpctrace_fmt_hdr_fwrite(hpctrace_hdr_flags_t flags, FILE *fs)
const metric_desc_t metricDesc_NULL
static const char HPCRUN_FMT_EpochTag[]
int hpcrun_fmt_hdr_fprint(hpcrun_fmt_hdr_t *hdr, FILE *outf)
void hpcrun_fmt_hdr_free(hpcrun_fmt_hdr_t *hdr, hpcfmt_free_fn dealloc)
struct metric_list_t metric_list_t
int hpcrun_fmt_loadmap_fread(loadmap_t *loadmap, FILE *infs, hpcfmt_alloc_fn alloc)
int hpcrun_fmt_loadmapEntry_fread(loadmap_entry_t *x, FILE *infs, hpcfmt_alloc_fn alloc)
#define HPCTRACE_FMT_FlagsLenX
int hpcrun_fmt_loadmap_fprint(loadmap_t *loadmap, FILE *outfs)
int hpcrun_fmt_epochHdr_fprint(hpcrun_fmt_epochHdr_t *ehdr, FILE *out)
static const int HPCRUN_FMT_VersionLen
char versionStr[sizeof(HPCRUN_FMT_Version)]
static const char HPCRUN_TraceFnmSfx[]
static const int HPCTRACE_FMT_FlagsLen
struct hpcrun_fmt_cct_node_t hpcrun_fmt_cct_node_t
static const int HPCMETRICDB_FMT_EndianLen
static const int HPCTRACE_FMT_VersionLen
union epoch_flags_t epoch_flags_t
static const char HPCRUN_ProfileFnmSfx[]
int hpcrun_fmt_cct_node_fread(hpcrun_fmt_cct_node_t *x, epoch_flags_t flags, FILE *fs)
void hpcrun_fmt_loadmapEntry_free(loadmap_entry_t *x, hpcfmt_free_fn dealloc)
static const char HPCMETRICDB_FMT_Magic[]
static bool hpcrun_fmt_node_type_root(uint16_t type)
hpcfmt_uint_t num_metrics
#define HPCMETRICDB_FMT_VersionLenX
struct metric_desc_t metric_desc_t
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)
int hpcmetricDB_fmt_hdr_fread(hpcmetricDB_fmt_hdr_t *hdr, FILE *infs)
struct metric_list_t * next
static const int HPCRUN_FMT_EpochTagLen
struct hpcrun_fmt_hdr_t hpcrun_fmt_hdr_t
void hpcrun_fmt_metricTbl_free(metric_tbl_t *metric_tbl, hpcfmt_free_fn dealloc)
int hpcmetricDB_fmt_hdr_fwrite(hpcmetricDB_fmt_hdr_t *hdr, FILE *outfs)
void hpcrun_fmt_loadmap_free(loadmap_t *loadmap, hpcfmt_free_fn dealloc)
int hpcrun_fmt_lip_fprint(lush_lip_t *x, FILE *fs, const char *pre)
hpcrun_metricFlags_fields fields
void hpcrun_fmt_metric_set_value(metric_desc_t metric_desc, hpcrun_metricVal_t *metric, double value)
struct hpcrun_fmt_epochHdr_t hpcrun_fmt_epochHdr_t
const hpcrun_metricFlags_t hpcrun_metricFlags_NULL
int hpcrun_fmt_loadmapEntry_fwrite(loadmap_entry_t *x, FILE *outfs)
static void hpcrun_fmt_cct_node_init(hpcrun_fmt_cct_node_t *x)
lush_assoc_info_t as_info
static const int HPCTRACE_FMT_EndianLen
int hpcrun_fmt_lip_fwrite(lush_lip_t *x, FILE *fs)
union hpcrun_metricVal_u hpcrun_metricVal_t
static const int HPCRUN_FMT_MagicLen
int hpctrace_fmt_datum_outbuf(hpctrace_fmt_datum_t *x, hpctrace_hdr_flags_t flags, hpcio_outbuf_t *outbuf)
uint32_t raToCallsiteOfst
int hpcrun_fmt_cct_node_fwrite(hpcrun_fmt_cct_node_t *x, epoch_flags_t flags, FILE *fs)
static const char HPCRUN_LogFnmSfx[]
int hpcrun_fmt_metricTbl_fread(metric_tbl_t *metric_tbl, metric_aux_info_t **aux_info, FILE *in, double fmtVersion, hpcfmt_alloc_fn alloc)
epoch_flags_bitfield fields
HPCFMT_List(hpcfmt_nvpair_t) nvps
int hpctrace_fmt_datum_fread(hpctrace_fmt_datum_t *x, hpctrace_hdr_flags_t flags, FILE *fs)
static const char HPCMETRICDB_FMT_Endian[]
int hpctrace_fmt_datum_fprint(hpctrace_fmt_datum_t *x, hpctrace_hdr_flags_t flags, FILE *fs)
static const int HPCRUN_FMT_EndianLen
union hpcrun_metricFlags_XXX_t hpcrun_metricFlags_XXX_t
static const char HPCPROF_TmpFnmSfx[]
#define HPCMETRICDB_FMT_EndianLenX
int hpcrun_fmt_epochHdr_fread(hpcrun_fmt_epochHdr_t *ehdr, FILE *fs, hpcfmt_alloc_fn alloc)
struct hpctrace_fmt_hdr_t hpctrace_fmt_hdr_t
uint64_t measurementGranularity
hpctrace_hdr_flags_bitfield fields
int hpcrun_fmt_metricDesc_fwrite(metric_desc_t *x, metric_aux_info_t *aux_info, FILE *outfs)
hpcrun_metricFlags_bitfield_XXX fields
hpctrace_hdr_flags_t flags
int hpcrun_fmt_loadmap_fwrite(loadmap_t *loadmap, FILE *outfs)
static bool hpcrun_fmt_node_type_allocation(uint16_t type)
void * hpcfmt_alloc_fn(size_t nbytes)
struct epoch_flags_bitfield epoch_flags_bitfield
static const char HPCPROF_MetricDBSfx[]
int metrics[MAX_EVENTS][MAX_METRICS]
const hpctrace_hdr_flags_t hpctrace_hdr_flags_NULL
static const double HPCRUN_FMT_Version_20
int hpcrun_fmt_lip_fread(lush_lip_t *x, FILE *fs)
static const char HPCMETRICDB_FMT_Version[]
static bool hpcrun_metricVal_isZero(hpcrun_metricVal_t x)
void hpcrun_fmt_metricDesc_free(metric_desc_t *x, hpcfmt_free_fn dealloc)
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)
struct hpcrun_metricFlags_fields hpcrun_metricFlags_fields
static const char HPCTRACE_FMT_Magic[]
struct hpcmetricDB_fmt_hdr_t hpcmetricDB_fmt_hdr_t
#define HPCTRACE_FMT_MagicLenX
metric_desc_t * metric_desc_p_t
void hpcrun_fmt_epochHdr_free(hpcrun_fmt_epochHdr_t *ehdr, hpcfmt_free_fn dealloc)
int hpctrace_fmt_hdr_fread(hpctrace_fmt_hdr_t *hdr, FILE *infs)
static const char HPCTRACE_FMT_Endian[]
static const int HPCTRACE_FMT_HeaderLen
MetricFlags_ValTy_t valTy
int hpcrun_fmt_metricTbl_fwrite(metric_desc_p_tbl_t *metric_tbl, metric_aux_info_t *aux_info, FILE *out)
#define HPCTRACE_FMT_EndianLenX
static const char HPCRUN_FMT_Version[]
metric_desc_properties_t properties
#define NODE_TYPE_ALLOCATION
static metric_desc_p_tbl_t metric_tbl
struct hpctrace_hdr_flags_bitfield hpctrace_hdr_flags_bitfield
hpcrun_metricFlags_t flags
static const int HPCMETRICDB_FMT_HeaderLen
void hpcrun_fmt_metric_set_value_real(hpcrun_metricFlags_t *flags, hpcrun_metricVal_t *metric, double value)
hpcrun_metricVal_t * metrics
int hpctrace_fmt_datum_fwrite(hpctrace_fmt_datum_t *x, hpctrace_hdr_flags_t flags, FILE *outfs)
static const char HPCRUN_FMT_Endian[]
int hpctrace_fmt_hdr_outbuf(hpctrace_hdr_flags_t flags, hpcio_outbuf_t *outbuf)
int hpcrun_fmt_metricDesc_fprint(metric_desc_t *x, metric_aux_info_t *aux_info, FILE *outfs, const char *pre)