LLVM OpenMP 22.0.0git
kmp_stats.cpp File Reference

Statistics gathering and processing. More...

#include "kmp.h"
#include "kmp_lock.h"
#include "kmp_stats.h"
#include "kmp_str.h"
#include <algorithm>
#include <ctime>
#include <iomanip>
#include <sstream>
#include <stdlib.h>
#include <cmath>

Go to the source code of this file.

Macros

#define STRINGIZE2(x)
#define STRINGIZE(x)
#define expandName(name, flags, ignore)
#define expandName(ignore1, ignore2, ignore3)

Functions

int compare_two_events (const void *event1, const void *event2)
static char const * lastName (char *name)
static char const * getImageName (char *buffer, size_t buflen)
static void getTime (char *buffer, size_t buflen, bool underscores=false)
static std::string generateFilename (char const *prototype, char const *imageName)
static void outputEnvVariable (FILE *statsOut, char const *name)
void __kmp_reset_stats ()
void __kmp_output_stats (const char *heading)
void __kmp_accumulate_stats_at_exit (void)
void __kmp_stats_init (void)
void __kmp_stats_fini (void)

Variables

static uint32_t statsPrinted = 0
static kmp_stats_output_module * __kmp_stats_global_output = NULL

Detailed Description

Statistics gathering and processing.

Definition in file kmp_stats.cpp.

Macro Definition Documentation

◆ expandName [1/2]

#define expandName ( ignore1,
ignore2,
ignore3 )
Value:
{0.0, 0.0, 0.0},

Definition at line 28 of file kmp_stats.cpp.

◆ expandName [2/2]

#define expandName ( name,
flags,
ignore )
Value:
{STRINGIZE(name), flags},
__itt_string_handle * name
Definition ittnotify.h:3305
#define STRINGIZE(x)
Definition kmp_stats.cpp:26

Definition at line 28 of file kmp_stats.cpp.

◆ STRINGIZE

#define STRINGIZE ( x)
Value:
#define STRINGIZE2(x)
Definition kmp_stats.cpp:25

Definition at line 26 of file kmp_stats.cpp.

◆ STRINGIZE2

#define STRINGIZE2 ( x)
Value:
#x

Definition at line 25 of file kmp_stats.cpp.

Function Documentation

◆ __kmp_accumulate_stats_at_exit()

void __kmp_accumulate_stats_at_exit ( void )

Definition at line 903 of file kmp_stats.cpp.

References __kmp_output_stats(), KMP_XCHG_FIXED32, and statsPrinted.

Referenced by __kmp_stats_fini().

◆ __kmp_output_stats()

void __kmp_output_stats ( const char * heading)

Definition at line 898 of file kmp_stats.cpp.

References __kmp_reset_stats(), and __kmp_stats_global_output.

Referenced by __kmp_accumulate_stats_at_exit().

◆ __kmp_reset_stats()

void __kmp_reset_stats ( )

Definition at line 879 of file kmp_stats.cpp.

References counter.

Referenced by __kmp_output_stats().

◆ __kmp_stats_fini()

void __kmp_stats_fini ( void )

Definition at line 918 of file kmp_stats.cpp.

References __kmp_accumulate_stats_at_exit(), and __kmp_stats_global_output.

Referenced by __kmp_cleanup().

◆ __kmp_stats_init()

void __kmp_stats_init ( void )

◆ compare_two_events()

int compare_two_events ( const void * event1,
const void * event2 )

Definition at line 367 of file kmp_stats.cpp.

References RCAST.

◆ generateFilename()

std::string generateFilename ( char const * prototype,
char const * imageName )
static

Definition at line 510 of file kmp_stats.cpp.

References char, getTime(), i, and res.

◆ getImageName()

char const * getImageName ( char * buffer,
size_t buflen )
static

Definition at line 478 of file kmp_stats.cpp.

References char, f(), KMP_CHECK_SYSFAIL, and lastName().

◆ getTime()

void getTime ( char * buffer,
size_t buflen,
bool underscores = false )
static

Definition at line 497 of file kmp_stats.cpp.

Referenced by generateFilename().

◆ lastName()

char const * lastName ( char * name)
static

Definition at line 466 of file kmp_stats.cpp.

References i, int, and name.

Referenced by getImageName().

◆ outputEnvVariable()

void outputEnvVariable ( FILE * statsOut,
char const * name )
static

Definition at line 758 of file kmp_stats.cpp.

References name, and value.

Variable Documentation

◆ __kmp_stats_global_output

kmp_stats_output_module* __kmp_stats_global_output = NULL
static

Definition at line 68 of file kmp_stats.cpp.

Referenced by __kmp_output_stats(), __kmp_stats_fini(), and __kmp_stats_init().

◆ statsPrinted

uint32_t statsPrinted = 0
static

Definition at line 65 of file kmp_stats.cpp.

Referenced by __kmp_accumulate_stats_at_exit().