HPCToolkit
files.c File Reference
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdbool.h>
#include "env.h"
#include "disabled.h"
#include "files.h"
#include "messages.h"
#include "thread_data.h"
#include "loadmap.h"
#include "sample_prob.h"
#include <lib/prof-lean/spinlock.h>
#include <lib/support-lean/OSUtil.h>
Include dependency graph for files.c:

Go to the source code of this file.

Classes

struct  fileid
 

Macros

#define FILENAME_TEMPLATE   "%s/%s-%06u-%03d-" HOSTID_FORMAT "-%u-%d.%s"
 
#define FILES_RANDOM_GEN   4
 
#define FILES_MAX_GEN   11
 
#define FILES_EARLY   0x1
 
#define FILES_LATE   0x2
 

Functions

static void hpcrun_rename_log_file_early (int rank)
 
static void hpcrun_files_init (void)
 
static int hpcrun_files_next_id (struct fileid *id)
 
static int hpcrun_open_file (int rank, int thread, const char *suffix, int flags)
 
static int hpcrun_rename_file (int rank, int thread, const char *suffix)
 
const char * hpcrun_files_executable_pathname ()
 
const char * hpcrun_files_executable_name ()
 
void hpcrun_files_set_directory ()
 
const char * hpcrun_files_output_directory ()
 
void hpcrun_files_set_executable (char *execname)
 
int hpcrun_open_log_file (void)
 
int hpcrun_open_trace_file (int thread)
 
int hpcrun_open_profile_file (int rank, int thread)
 
int hpcrun_rename_log_file (int rank)
 
int hpcrun_rename_trace_file (int rank, int thread)
 

Variables

static char default_path [PATH_MAX] = {'\0'}
 
static char output_directory [PATH_MAX] = {'\0'}
 
static char executable_name [PATH_MAX] = {'\0'}
 
static char executable_pathname [PATH_MAX] = {'\0'}
 
static spinlock_t files_lock = SPINLOCK_UNLOCKED
 
static pid_t mypid = 0
 
static struct fileid earlyid
 
static struct fileid lateid
 
static int log_done = 0
 
static int log_rename_done = 0
 
static int log_rename_ret = 0
 

Macro Definition Documentation

◆ FILENAME_TEMPLATE

#define FILENAME_TEMPLATE   "%s/%s-%06u-%03d-" HOSTID_FORMAT "-%u-%d.%s"

Definition at line 140 of file files.c.

◆ FILES_EARLY

#define FILES_EARLY   0x1

Definition at line 145 of file files.c.

◆ FILES_LATE

#define FILES_LATE   0x2

Definition at line 146 of file files.c.

◆ FILES_MAX_GEN

#define FILES_MAX_GEN   11

Definition at line 143 of file files.c.

◆ FILES_RANDOM_GEN

#define FILES_RANDOM_GEN   4

Definition at line 142 of file files.c.

Function Documentation

◆ hpcrun_files_executable_name()

const char* hpcrun_files_executable_name ( )

Definition at line 376 of file files.c.

Here is the caller graph for this function:

◆ hpcrun_files_executable_pathname()

const char* hpcrun_files_executable_pathname ( )

Definition at line 367 of file files.c.

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

◆ hpcrun_files_init()

static void hpcrun_files_init ( void  )
static

Definition at line 192 of file files.c.

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

◆ hpcrun_files_next_id()

static int hpcrun_files_next_id ( struct fileid id)
static

Definition at line 217 of file files.c.

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

◆ hpcrun_files_output_directory()

const char* hpcrun_files_output_directory ( )

Definition at line 413 of file files.c.

Here is the caller graph for this function:

◆ hpcrun_files_set_directory()

void hpcrun_files_set_directory ( )

Definition at line 383 of file files.c.

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

◆ hpcrun_files_set_executable()

void hpcrun_files_set_executable ( char *  execname)

Definition at line 420 of file files.c.

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

◆ hpcrun_open_file()

static int hpcrun_open_file ( int  rank,
int  thread,
const char *  suffix,
int  flags 
)
static

Definition at line 251 of file files.c.

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

◆ hpcrun_open_log_file()

int hpcrun_open_log_file ( void  )

Definition at line 432 of file files.c.

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

◆ hpcrun_open_profile_file()

int hpcrun_open_profile_file ( int  rank,
int  thread 
)

Definition at line 469 of file files.c.

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

◆ hpcrun_open_trace_file()

int hpcrun_open_trace_file ( int  thread)

Definition at line 450 of file files.c.

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

◆ hpcrun_rename_file()

static int hpcrun_rename_file ( int  rank,
int  thread,
const char *  suffix 
)
static

Definition at line 310 of file files.c.

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

◆ hpcrun_rename_log_file()

int hpcrun_rename_log_file ( int  rank)

Definition at line 500 of file files.c.

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

◆ hpcrun_rename_log_file_early()

static void hpcrun_rename_log_file_early ( int  rank)
static

Definition at line 489 of file files.c.

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

◆ hpcrun_rename_trace_file()

int hpcrun_rename_trace_file ( int  rank,
int  thread 
)

Definition at line 512 of file files.c.

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

Variable Documentation

◆ default_path

char default_path[PATH_MAX] = {'\0'}
static

Definition at line 166 of file files.c.

◆ earlyid

struct fileid earlyid
static

Definition at line 176 of file files.c.

◆ executable_name

char executable_name[PATH_MAX] = {'\0'}
static

Definition at line 168 of file files.c.

◆ executable_pathname

char executable_pathname[PATH_MAX] = {'\0'}
static

Definition at line 169 of file files.c.

◆ files_lock

spinlock_t files_lock = SPINLOCK_UNLOCKED
static

Definition at line 174 of file files.c.

◆ lateid

struct fileid lateid
static

Definition at line 177 of file files.c.

◆ log_done

int log_done = 0
static

Definition at line 178 of file files.c.

◆ log_rename_done

int log_rename_done = 0
static

Definition at line 179 of file files.c.

◆ log_rename_ret

int log_rename_ret = 0
static

Definition at line 180 of file files.c.

◆ mypid

pid_t mypid = 0
static

Definition at line 175 of file files.c.

◆ output_directory

char output_directory[PATH_MAX] = {'\0'}
static

Definition at line 167 of file files.c.