149 fs = fdopen(fd,
"w");
151 EEMSG(
"HPCToolkit: %s: unable to open profile file", __func__);
159 const uint bufSZ = 32;
166 char mpiRankStr[bufSZ];
167 mpiRankStr[0] =
'\0';
168 snprintf(mpiRankStr, bufSZ,
"%d", rank);
171 snprintf(tidStr, bufSZ,
"%d", cptd->
id);
173 char hostidStr[bufSZ];
179 char traceMinTimeStr[bufSZ];
182 char traceMaxTimeStr[bufSZ];
189 TMSG(DATA_WRITE,
"writing file header");
209 uint32_t num_epochs = 0;
218 epoch_t* current_epoch = epoch;
223 TMSG(EPOCH,
"Actual # epochs = %d", num_epochs);
225 TMSG(DATA_WRITE,
"writing # epochs = %d", num_epochs);
234 if (
ENABLED(SKIP_WRITE_EMPTY_EPOCH)){
235 if (hpcrun_empty_cct_bundle(&(s->csdata))){
236 EMSG(
"Empty cct encountered: it is not written out");
245 TMSG(DATA_WRITE,
" epoch header");
253 TMSG(DATA_WRITE,
"epoch flags = %"PRIx64
"", epoch_flags.
bits);
256 "TODO:epoch-name",
"TODO:epoch-value",
265 TMSG(DATA_WRITE,
"metric tbl len = %d", metric_tbl->len);
268 TMSG(DATA_WRITE,
"Done writing metric data");
274 TMSG(DATA_WRITE,
"Preparing to write loadmap");
282 (lm_src); lm_src = lm_src->
prev) {
284 lm_entry.
id = lm_src->id;
285 lm_entry.
name = lm_src->name;
291 TMSG(DATA_WRITE,
"Done writing loadmap");
300 TMSG(DATA_WRITE,
"Error writing tree %#lx", cct);
301 TMSG(DATA_WRITE,
"Number of tree nodes lost: %ld", cct->
num_nodes);
302 EMSG(
"could not save profile data to hpcrun file");
303 perror(
"write_profile_data");
307 TMSG(DATA_WRITE,
"saved profile data to hpcrun file ");
331 TMSG(DATA_WRITE,
"Writing hpcrun profile data");
338 TMSG(DATA_WRITE,
"closing file");
340 TMSG(DATA_WRITE,
"Done!");
#define HPCRUN_FMT_NV_tid
static const uint64_t default_measurement_granularity
metric_aux_info_t * perf_event_info
#define HPCRUN_FMT_NV_progPath
static bool hpcrun_isLogicalUnwind()
void hpcrun_dbg_print_current_loadmap(void)
static int write_epochs(FILE *fs, core_profile_trace_data_t *cptd, epoch_t *epoch)
const char * hpcrun_files_executable_name()
static int hpcfmt_int4_fwrite(uint32_t val, FILE *outfs)
#define hpcrun_get_thread_epoch()
static epoch_flags_t epoch_flags
metric_desc_p_tbl_t * hpcrun_get_metric_tbl()
int hpcrun_write_profile_data(core_profile_trace_data_t *cptd)
uint64_t trace_max_time_us
int hpcrun_fmt_hdr_fwrite(FILE *fs,...)
int hpcrun_sample_prob_active(void)
#define HPCRUN_FMT_NV_mpiRank
void hpcrun_flush_epochs(core_profile_trace_data_t *cptd)
int hpcrun_fmt_metricTbl_fwrite(metric_desc_p_tbl_t *metric_tbl, metric_aux_info_t *aux_info, FILE *fs)
int hpcrun_open_profile_file(int rank, int thread)
#define HPCRUN_FMT_NV_pid
epoch_flags_bitfield fields
void hpcrun_loadmap_print(hpcrun_loadmap_t *loadmap)
#define HPCRUN_FMT_NV_hostid
#define HPCRUN_FMT_NV_traceMaxTime
const char * hpcrun_files_executable_pathname()
int hpcrun_get_rank(void)
#define HPCRUN_FMT_NV_envPath
static FILE * lazy_open_data_file(core_profile_trace_data_t *cptd)
#define HPCRUN_FMT_NV_jobId
#define HPCRUN_FMT_NV_traceMinTime
int hpcrun_fmt_loadmapEntry_fwrite(loadmap_entry_t *x, FILE *fs)
const char * OSUtil_jobid()
cct2metrics_t * cct2metrics_map
int hpcio_fclose(FILE *fs)
uint64_t trace_min_time_us
int hpcrun_fmt_epochHdr_fwrite(FILE *fs, epoch_flags_t flags, uint64_t measurementGranularity,...)
int hpcrun_cct_bundle_fwrite(FILE *fs, epoch_flags_t flags, cct_bundle_t *bndl, cct2metrics_t *cct2metrics_map)
void hpcrun_epoch_reset(void)
static metric_desc_p_tbl_t metric_tbl
struct load_module_t * prev
#define HPCRUN_FMT_NV_prog