powerd++  0.4.4
Typedefs | Enumerations | Functions | Variables
anonymous_namespace{loadrec.cpp} Namespace Reference

File local scope. More...

Typedefs

template<auto Ownership>
using ofile = io::file< Ownership, io::write >
 Output file type alias. More...
 

Enumerations

enum  OE {
  OE::USAGE, OE::IVAL_DURATION, OE::IVAL_POLL, OE::FILE_OUTPUT,
  OE::FILE_PID, OE::FLAG_VERBOSE, OE::OPT_UNKNOWN, OE::OPT_NOOPT,
  OE::OPT_DASH, OE::OPT_LDASH, OE::OPT_DONE
}
 An enum for command line parsing. More...
 

Functions

template<typename... MsgTs>
void verbose (MsgTs &&... msg)
 Outputs the given printf style message on stderr if g.verbose is set. More...
 
void init ()
 Set up output to the given file.
 
void read_args (int const argc, char const *const argv[])
 Parse command line arguments. More...
 
void print_sysctls ()
 Print the sysctls. More...
 
void run ()
 Report the load frames. More...
 

Variables

constexpr const flag_t FEATURES
 The set of supported features. More...
 
struct {
bool verbose {false}
 Verbosity flag.
 
ms duration {30000}
 Recording duration in ms.
 
ms interval {25}
 Recording sample interval in ms.
 
ofile< io::link > fout = io::fout
 The output stream either io::fout (stdout) or a file.
 
const char * outfilename {nullptr}
 The user provided output file name.
 
const SysctlOnce< coreid_t, 2 > ncpu {1U, {CTL_HW, HW_NCPU}}
 The number of CPU cores/threads.
 
g
 The global state.
 
const char *const USAGE = "[-hv] [-d ival] [-p ival] [-o file]"
 The short usage string.
 
const Parameter< OEPARAMETERS []
 Definitions of command line parameters. More...
 

Detailed Description

File local scope.

Typedef Documentation

◆ ofile

template<auto Ownership>
using anonymous_namespace{loadrec.cpp}::ofile = typedef io::file<Ownership, io::write>

Output file type alias.

Template Parameters
OwnershipThe io::ownership type of the file

Enumeration Type Documentation

◆ OE

enum anonymous_namespace{loadrec.cpp}::OE
strong

An enum for command line parsing.

Enumerator
USAGE 

Print help.

IVAL_DURATION 

Set the duration of the recording.

IVAL_POLL 

Set polling interval.

FILE_OUTPUT 

Set output file.

FILE_PID 

Set PID file.

FLAG_VERBOSE 

Verbose output on stderr.

OPT_UNKNOWN 

Obligatory.

OPT_NOOPT 

Obligatory.

OPT_DASH 

Obligatory.

OPT_LDASH 

Obligatory.

OPT_DONE 

Obligatory.

Function Documentation

◆ print_sysctls()

void anonymous_namespace{loadrec.cpp}::print_sysctls ( )

Print the sysctls.

◆ read_args()

void anonymous_namespace{loadrec.cpp}::read_args ( int const  argc,
char const *const  argv[] 
)

Parse command line arguments.

Parameters
argc,argvThe command line arguments

◆ run()

void anonymous_namespace{loadrec.cpp}::run ( )

Report the load frames.

This prints the time in ms since the last frame and the cp_times growth as a space separated list.

◆ verbose()

template<typename... MsgTs>
void anonymous_namespace{loadrec.cpp}::verbose ( MsgTs &&...  msg)
inline

Outputs the given printf style message on stderr if g.verbose is set.

Template Parameters
MsgTsThe message argument types
Parameters
msgThe message to output

Variable Documentation

◆ FEATURES

constexpr const flag_t anonymous_namespace{loadrec.cpp}::FEATURES
constexpr
Initial value:
{
1_FREQ_TRACKING
}

The set of supported features.

This value is stored in load recordings to allow loadplay to correctly interpret the data.

◆ PARAMETERS

const Parameter<OE> anonymous_namespace{loadrec.cpp}::PARAMETERS[]
Initial value:
{
{OE::USAGE, 'h', "help", "", "Show usage and exit"},
{OE::FLAG_VERBOSE, 'v', "verbose", "", "Be verbose"},
{OE::IVAL_DURATION, 'd', "duration", "ival", "The duration of the recording"},
{OE::IVAL_POLL, 'p', "poll", "ival", "The polling interval"},
{OE::FILE_OUTPUT, 'o', "output", "file", "Output to file"},
{OE::FILE_PID, 'P', "pid", "file", "Ignored"},
}

Definitions of command line parameters.

anonymous_namespace{loadrec.cpp}::USAGE
const char *const USAGE
The short usage string.
Definition: loadrec.cpp:128