Intel(r) Performance Counter Monitor
Classes | Macros | Functions
utils.h File Reference

Some common utility routines. More...

#include <cstdio>
#include <cstring>
#include <fstream>
#include "cpucounters.h"
#include <csignal>
#include <ctime>
#include <cmath>

Go to the source code of this file.

Classes

struct  null_stream
 

Macros

#define PCM_UNUSED(x)   (void)(x)
 
#define PCM_COMPILE_ASSERT(condition)
 

Functions

void exit_cleanup (void)
 handler of exit() call
 
void set_signal_handlers (void)
 install various handlers for system signals
 
void restore_signal_handlers (void)
 Restores default signal handlers under Linux/UNIX.
 
void sigINT_handler (int signum)
 handles signals that lead to termination of the program such as SIGINT, SIGQUIT, SIGABRT, SIGSEGV, SIGTERM, SIGCHLD this function specifically works when the client aplication launched by pcm – terminates
 
void sigHUP_handler (int signum)
 handles signals that lead to restart the application such as SIGHUP. for example to re-read environment variables controlling PCM execution
 
void sigUSR_handler (int signum)
 handles signals that lead to update of configuration such as SIGUSR1 and SIGUSR2. for the future extensions
 
void sigSTOP_handler (int signum)
 handles signals that lead to update of configuration such as SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU
 
void sigCONT_handler (int signum)
 handles signals that lead to update of configuration such as SIGCONT
 
void MySleep (int delay)
 
void MySleepMs (int delay_ms)
 
void MySleepUs (int delay_us)
 
void MySystem (char *sysCmd, char **argc)
 launches external program in a separate process
 
template<class IntType >
std::string unit_format (IntType n)
 

Detailed Description

Some common utility routines.

Macro Definition Documentation

#define PCM_COMPILE_ASSERT (   condition)
Value:
typedef char pcm_compile_assert_failed [ (condition) ? 1 : -1 ]; \
pcm_compile_assert_failed pcm_compile_assert_failed_; \
PCM_UNUSED(pcm_compile_assert_failed_);