HPCToolkit
hpcrun-fmt.c File Reference
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/stat.h>
#include <include/gcc-attr.h>
#include "hpcio.h"
#include "hpcio-buffer.h"
#include "hpcfmt.h"
#include "hpcrun-fmt.h"
Include dependency graph for hpcrun-fmt.c:

Go to the source code of this file.

Functions

int hpcrun_fmt_hdr_fread (hpcrun_fmt_hdr_t *hdr, FILE *infs, hpcfmt_alloc_fn alloc)
 
int hpcrun_fmt_hdr_fwrite (FILE *fs,...)
 
int hpcrun_fmt_hdr_fprint (hpcrun_fmt_hdr_t *hdr, FILE *fs)
 
void hpcrun_fmt_hdr_free (hpcrun_fmt_hdr_t *hdr, hpcfmt_free_fn dealloc)
 
int hpcrun_fmt_epochHdr_fread (hpcrun_fmt_epochHdr_t *ehdr, FILE *fs, hpcfmt_alloc_fn alloc)
 
int hpcrun_fmt_epochHdr_fwrite (FILE *fs, epoch_flags_t flags, uint64_t measurementGranularity,...)
 
int hpcrun_fmt_epochHdr_fprint (hpcrun_fmt_epochHdr_t *ehdr, FILE *fs)
 
void hpcrun_fmt_epochHdr_free (hpcrun_fmt_epochHdr_t *ehdr, hpcfmt_free_fn dealloc)
 
int hpcrun_fmt_metricTbl_fread (metric_tbl_t *metric_tbl, metric_aux_info_t **aux_info, FILE *fs, double fmtVersion, hpcfmt_alloc_fn alloc)
 
int hpcrun_fmt_metricTbl_fwrite (metric_desc_p_tbl_t *metric_tbl, metric_aux_info_t *aux_info, FILE *fs)
 
int hpcrun_fmt_metricTbl_fprint (metric_tbl_t *metric_tbl, metric_aux_info_t *aux_info, FILE *fs)
 
void hpcrun_fmt_metricTbl_free (metric_tbl_t *metric_tbl, hpcfmt_free_fn dealloc)
 
int hpcrun_fmt_metricDesc_fread (metric_desc_t *x, metric_aux_info_t *aux_info, FILE *fs, double GCC_ATTR_UNUSED fmtVersion, hpcfmt_alloc_fn alloc)
 
int hpcrun_fmt_metricDesc_fwrite (metric_desc_t *x, metric_aux_info_t *aux_info, FILE *fs)
 
int hpcrun_fmt_metricDesc_fprint (metric_desc_t *x, metric_aux_info_t *aux_info, FILE *fs, const char *pre)
 
void hpcrun_fmt_metricDesc_free (metric_desc_t *x, hpcfmt_free_fn dealloc)
 
double hpcrun_fmt_metric_get_value (metric_desc_t metric_desc, hpcrun_metricVal_t metric)
 
void hpcrun_fmt_metric_set_value (metric_desc_t metric_desc, hpcrun_metricVal_t *metric, double value)
 
void hpcrun_fmt_metric_set_value_int (hpcrun_metricFlags_t *flags, hpcrun_metricVal_t *metric, int value)
 
void hpcrun_fmt_metric_set_value_real (hpcrun_metricFlags_t *flags, hpcrun_metricVal_t *metric, double value)
 
void hpcrun_fmt_metric_set_value_address (hpcrun_metricFlags_t *flags, hpcrun_metricVal_t *metric, double value)
 
int hpcrun_fmt_loadmap_fread (loadmap_t *loadmap, FILE *fs, hpcfmt_alloc_fn alloc)
 
int hpcrun_fmt_loadmap_fwrite (loadmap_t *loadmap, FILE *fs)
 
int hpcrun_fmt_loadmap_fprint (loadmap_t *loadmap, FILE *fs)
 
void hpcrun_fmt_loadmap_free (loadmap_t *loadmap, hpcfmt_free_fn dealloc)
 
int hpcrun_fmt_loadmapEntry_fread (loadmap_entry_t *x, FILE *fs, hpcfmt_alloc_fn alloc)
 
int hpcrun_fmt_loadmapEntry_fwrite (loadmap_entry_t *x, FILE *fs)
 
int hpcrun_fmt_loadmapEntry_fprint (loadmap_entry_t *x, FILE *fs, const char *pre)
 
void hpcrun_fmt_loadmapEntry_free (loadmap_entry_t *x, hpcfmt_free_fn dealloc)
 
int hpcrun_fmt_cct_node_fread (hpcrun_fmt_cct_node_t *x, epoch_flags_t flags, FILE *fs)
 
int hpcrun_fmt_cct_node_fwrite (hpcrun_fmt_cct_node_t *x, epoch_flags_t flags, FILE *fs)
 
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)
 
int hpcrun_fmt_lip_fread (lush_lip_t *x, FILE *fs)
 
int hpcrun_fmt_lip_fwrite (lush_lip_t *x, FILE *fs)
 
int hpcrun_fmt_lip_fprint (lush_lip_t *x, FILE *fs, const char *pre)
 
int hpctrace_fmt_hdr_fread (hpctrace_fmt_hdr_t *hdr, FILE *infs)
 
int hpctrace_fmt_hdr_outbuf (hpctrace_hdr_flags_t flags, hpcio_outbuf_t *outbuf)
 
int hpctrace_fmt_hdr_fwrite (hpctrace_hdr_flags_t flags, FILE *fs)
 
int hpctrace_fmt_hdr_fprint (hpctrace_fmt_hdr_t *hdr, FILE *fs)
 
int hpctrace_fmt_datum_fread (hpctrace_fmt_datum_t *x, hpctrace_hdr_flags_t flags, FILE *fs)
 
int hpctrace_fmt_datum_outbuf (hpctrace_fmt_datum_t *x, hpctrace_hdr_flags_t flags, hpcio_outbuf_t *outbuf)
 
int hpctrace_fmt_datum_fwrite (hpctrace_fmt_datum_t *x, hpctrace_hdr_flags_t flags, FILE *outfs)
 
int hpctrace_fmt_datum_fprint (hpctrace_fmt_datum_t *x, hpctrace_hdr_flags_t flags, FILE *fs)
 
int hpcmetricDB_fmt_hdr_fread (hpcmetricDB_fmt_hdr_t *hdr, FILE *infs)
 
int hpcmetricDB_fmt_hdr_fwrite (hpcmetricDB_fmt_hdr_t *hdr, FILE *outfs)
 
int hpcmetricDB_fmt_hdr_fprint (hpcmetricDB_fmt_hdr_t *hdr, FILE *outfs)
 

Variables

const metric_desc_t metricDesc_NULL
 
const hpcrun_metricFlags_t hpcrun_metricFlags_NULL
 
hpcrun_metricVal_t hpcrun_metricVal_ZERO = { .bits = 0 }
 
const hpctrace_hdr_flags_t hpctrace_hdr_flags_NULL
 

Function Documentation

◆ hpcmetricDB_fmt_hdr_fprint()

int hpcmetricDB_fmt_hdr_fprint ( hpcmetricDB_fmt_hdr_t hdr,
FILE *  outfs 
)

Definition at line 1057 of file hpcrun-fmt.c.

Here is the caller graph for this function:

◆ hpcmetricDB_fmt_hdr_fread()

int hpcmetricDB_fmt_hdr_fread ( hpcmetricDB_fmt_hdr_t hdr,
FILE *  infs 
)

Definition at line 1000 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcmetricDB_fmt_hdr_fwrite()

int hpcmetricDB_fmt_hdr_fwrite ( hpcmetricDB_fmt_hdr_t hdr,
FILE *  outfs 
)

Definition at line 1036 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_cct_node_fprint()

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 at line 688 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_cct_node_fread()

int hpcrun_fmt_cct_node_fread ( hpcrun_fmt_cct_node_t x,
epoch_flags_t  flags,
FILE *  fs 
)

Definition at line 631 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_cct_node_fwrite()

int hpcrun_fmt_cct_node_fwrite ( hpcrun_fmt_cct_node_t x,
epoch_flags_t  flags,
FILE *  fs 
)

Definition at line 660 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_epochHdr_fprint()

int hpcrun_fmt_epochHdr_fprint ( hpcrun_fmt_epochHdr_t ehdr,
FILE *  fs 
)

Definition at line 227 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_epochHdr_fread()

int hpcrun_fmt_epochHdr_fread ( hpcrun_fmt_epochHdr_t ehdr,
FILE *  fs,
hpcfmt_alloc_fn  alloc 
)

Definition at line 172 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_epochHdr_free()

void hpcrun_fmt_epochHdr_free ( hpcrun_fmt_epochHdr_t ehdr,
hpcfmt_free_fn  dealloc 
)

Definition at line 242 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_epochHdr_fwrite()

int hpcrun_fmt_epochHdr_fwrite ( FILE *  fs,
epoch_flags_t  flags,
uint64_t  measurementGranularity,
  ... 
)

Definition at line 201 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_hdr_fprint()

int hpcrun_fmt_hdr_fprint ( hpcrun_fmt_hdr_t hdr,
FILE *  fs 
)

Definition at line 144 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_hdr_fread()

int hpcrun_fmt_hdr_fread ( hpcrun_fmt_hdr_t hdr,
FILE *  infs,
hpcfmt_alloc_fn  alloc 
)

Definition at line 93 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_hdr_free()

void hpcrun_fmt_hdr_free ( hpcrun_fmt_hdr_t hdr,
hpcfmt_free_fn  dealloc 
)

Definition at line 159 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_hdr_fwrite()

int hpcrun_fmt_hdr_fwrite ( FILE *  fs,
  ... 
)

Definition at line 126 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_lip_fprint()

int hpcrun_fmt_lip_fprint ( lush_lip_t x,
FILE *  fs,
const char *  pre 
)

Definition at line 770 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_lip_fread()

int hpcrun_fmt_lip_fread ( lush_lip_t x,
FILE *  fs 
)

Definition at line 748 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_lip_fwrite()

int hpcrun_fmt_lip_fwrite ( lush_lip_t x,
FILE *  fs 
)

Definition at line 759 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_loadmap_fprint()

int hpcrun_fmt_loadmap_fprint ( loadmap_t *  loadmap,
FILE *  fs 
)

Definition at line 561 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_loadmap_fread()

int hpcrun_fmt_loadmap_fread ( loadmap_t *  loadmap,
FILE *  fs,
hpcfmt_alloc_fn  alloc 
)

Definition at line 531 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_loadmap_free()

void hpcrun_fmt_loadmap_free ( loadmap_t *  loadmap,
hpcfmt_free_fn  dealloc 
)

Definition at line 575 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_loadmap_fwrite()

int hpcrun_fmt_loadmap_fwrite ( loadmap_t *  loadmap,
FILE *  fs 
)

Definition at line 548 of file hpcrun-fmt.c.

Here is the call graph for this function:

◆ hpcrun_fmt_loadmapEntry_fprint()

int hpcrun_fmt_loadmapEntry_fprint ( loadmap_entry_t x,
FILE *  fs,
const char *  pre 
)

Definition at line 610 of file hpcrun-fmt.c.

Here is the caller graph for this function:

◆ hpcrun_fmt_loadmapEntry_fread()

int hpcrun_fmt_loadmapEntry_fread ( loadmap_entry_t x,
FILE *  fs,
hpcfmt_alloc_fn  alloc 
)

Definition at line 589 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_loadmapEntry_free()

void hpcrun_fmt_loadmapEntry_free ( loadmap_entry_t x,
hpcfmt_free_fn  dealloc 
)

Definition at line 619 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_loadmapEntry_fwrite()

int hpcrun_fmt_loadmapEntry_fwrite ( loadmap_entry_t x,
FILE *  fs 
)

Definition at line 600 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_metric_get_value()

double hpcrun_fmt_metric_get_value ( metric_desc_t  metric_desc,
hpcrun_metricVal_t  metric 
)

Definition at line 464 of file hpcrun-fmt.c.

Here is the caller graph for this function:

◆ hpcrun_fmt_metric_set_value()

void hpcrun_fmt_metric_set_value ( metric_desc_t  metric_desc,
hpcrun_metricVal_t metric,
double  value 
)

Definition at line 482 of file hpcrun-fmt.c.

Here is the caller graph for this function:

◆ hpcrun_fmt_metric_set_value_address()

void hpcrun_fmt_metric_set_value_address ( hpcrun_metricFlags_t flags,
hpcrun_metricVal_t metric,
double  value 
)

Definition at line 519 of file hpcrun-fmt.c.

◆ hpcrun_fmt_metric_set_value_int()

void hpcrun_fmt_metric_set_value_int ( hpcrun_metricFlags_t flags,
hpcrun_metricVal_t metric,
int  value 
)

Definition at line 501 of file hpcrun-fmt.c.

◆ hpcrun_fmt_metric_set_value_real()

void hpcrun_fmt_metric_set_value_real ( hpcrun_metricFlags_t flags,
hpcrun_metricVal_t metric,
double  value 
)

Definition at line 511 of file hpcrun-fmt.c.

◆ hpcrun_fmt_metricDesc_fprint()

int hpcrun_fmt_metricDesc_fprint ( metric_desc_t x,
metric_aux_info_t aux_info,
FILE *  fs,
const char *  pre 
)

Definition at line 432 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_metricDesc_fread()

int hpcrun_fmt_metricDesc_fread ( metric_desc_t x,
metric_aux_info_t aux_info,
FILE *  fs,
double GCC_ATTR_UNUSED  fmtVersion,
hpcfmt_alloc_fn  alloc 
)

Definition at line 362 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_metricDesc_free()

void hpcrun_fmt_metricDesc_free ( metric_desc_t x,
hpcfmt_free_fn  dealloc 
)

Definition at line 451 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_metricDesc_fwrite()

int hpcrun_fmt_metricDesc_fwrite ( metric_desc_t x,
metric_aux_info_t aux_info,
FILE *  fs 
)

Definition at line 412 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_metricTbl_fprint()

int hpcrun_fmt_metricTbl_fprint ( metric_tbl_t *  metric_tbl,
metric_aux_info_t aux_info,
FILE *  fs 
)

Definition at line 334 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_metricTbl_fread()

int hpcrun_fmt_metricTbl_fread ( metric_tbl_t *  metric_tbl,
metric_aux_info_t **  aux_info,
FILE *  fs,
double  fmtVersion,
hpcfmt_alloc_fn  alloc 
)

Definition at line 283 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_metricTbl_free()

void hpcrun_fmt_metricTbl_free ( metric_tbl_t *  metric_tbl,
hpcfmt_free_fn  dealloc 
)

Definition at line 348 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpcrun_fmt_metricTbl_fwrite()

int hpcrun_fmt_metricTbl_fwrite ( metric_desc_p_tbl_t *  metric_tbl,
metric_aux_info_t aux_info,
FILE *  fs 
)

Definition at line 307 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpctrace_fmt_datum_fprint()

int hpctrace_fmt_datum_fprint ( hpctrace_fmt_datum_t x,
hpctrace_hdr_flags_t  flags,
FILE *  fs 
)

Definition at line 979 of file hpcrun-fmt.c.

Here is the caller graph for this function:

◆ hpctrace_fmt_datum_fread()

int hpctrace_fmt_datum_fread ( hpctrace_fmt_datum_t x,
hpctrace_hdr_flags_t  flags,
FILE *  fs 
)

Definition at line 901 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpctrace_fmt_datum_fwrite()

int hpctrace_fmt_datum_fwrite ( hpctrace_fmt_datum_t x,
hpctrace_hdr_flags_t  flags,
FILE *  outfs 
)

Definition at line 965 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpctrace_fmt_datum_outbuf()

int hpctrace_fmt_datum_outbuf ( hpctrace_fmt_datum_t x,
hpctrace_hdr_flags_t  flags,
hpcio_outbuf_t outbuf 
)

Definition at line 927 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpctrace_fmt_hdr_fprint()

int hpctrace_fmt_hdr_fprint ( hpctrace_fmt_hdr_t hdr,
FILE *  fs 
)

Definition at line 882 of file hpcrun-fmt.c.

Here is the caller graph for this function:

◆ hpctrace_fmt_hdr_fread()

int hpctrace_fmt_hdr_fread ( hpctrace_fmt_hdr_t hdr,
FILE *  infs 
)

Definition at line 795 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpctrace_fmt_hdr_fwrite()

int hpctrace_fmt_hdr_fwrite ( hpctrace_hdr_flags_t  flags,
FILE *  fs 
)

Definition at line 862 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpctrace_fmt_hdr_outbuf()

int hpctrace_fmt_hdr_outbuf ( hpctrace_hdr_flags_t  flags,
hpcio_outbuf_t outbuf 
)

Definition at line 833 of file hpcrun-fmt.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ hpcrun_metricFlags_NULL

const hpcrun_metricFlags_t hpcrun_metricFlags_NULL
Initial value:
= {
.fields.ty = MetricFlags_Ty_NULL,
.fields.valTy = MetricFlags_ValTy_NULL,
.fields.valFmt = MetricFlags_ValFmt_NULL,
.fields.unused0 = 0,
.fields.partner = 0,
.fields.show = (uint8_t)true,
.fields.showPercent = (uint8_t)true,
.fields.unused1 = 0,
}

Definition at line 265 of file hpcrun-fmt.c.

◆ hpcrun_metricVal_ZERO

hpcrun_metricVal_t hpcrun_metricVal_ZERO = { .bits = 0 }

Definition at line 278 of file hpcrun-fmt.c.

◆ hpctrace_hdr_flags_NULL

const hpctrace_hdr_flags_t hpctrace_hdr_flags_NULL
Initial value:
= {
.bits = 0
}

Definition at line 789 of file hpcrun-fmt.c.

◆ metricDesc_NULL

const metric_desc_t metricDesc_NULL
Initial value:
= {
.name = NULL,
.description = NULL,
.flags.bits_big[0] = 0,
.flags.bits_big[1] = 0,
.period = 0,
.properties = {.time = 0,.cycles = 0},
.formula = NULL,
.format = NULL,
}
#define NULL
Definition: ElfHelper.cpp:85

Definition at line 254 of file hpcrun-fmt.c.