Knobs automate the parsing and management of command line switches. A command line contains switches for Pin, the tool, and the application. The knobs parsing code understands how to separate them.
- Availability:
- Mode: JIT & Probe
O/S: Linux & Windows
CPU: All
◆ KNOB_MODE
This module contains routines and classes for the processing of command line arguments.
Per knob mode - indicates how multiple appearances of the mode on the command line are handled
Enumerator |
---|
KNOB_MODE_COMMENT | comment for knob family
|
KNOB_MODE_WRITEONCE | single value, single write
|
KNOB_MODE_OVERWRITE | single value, overwrite, unless the user set the knob from command line.
|
KNOB_MODE_ACCUMULATE | single value, update
|
KNOB_MODE_APPEND | list of values, append
|
◆ CheckAllKnobs()
STATIC VOID KNOB_BASE::CheckAllKnobs |
( |
BOOL |
allowDashes = FALSE | ) |
|
Check for duplicates amongst the declared knobs
◆ Compare()
int KNOB_BASE::Compare |
( |
const KNOB_BASE & |
k2 | ) |
const |
- Returns
- TRUE if two knobs are identical.
◆ DisableKnob()
STATIC VOID KNOB_BASE::DisableKnob |
( |
const std::string & |
myname | ) |
|
Disable a particular knob
- Parameters
-
myname | The particular knob to disable |
◆ DisableKnobFamily()
STATIC VOID KNOB_BASE::DisableKnobFamily |
( |
const std::string & |
myfamily | ) |
|
Disable all options within a given family of knobs
- Parameters
-
myfamily | The family to disable |
◆ EnableKnob()
STATIC VOID KNOB_BASE::EnableKnob |
( |
const std::string & |
myname | ) |
|
Enable a particular knob
- Parameters
-
◆ EnableKnobFamily()
STATIC VOID KNOB_BASE::EnableKnobFamily |
( |
const std::string & |
myfamily | ) |
|
Enable all options within a given family of knobs
- Parameters
-
myfamily | The family to enable |
◆ FindEnabledKnob()
STATIC KNOB_BASE* KNOB_BASE::FindEnabledKnob |
( |
const std::string & |
name | ) |
|
Search for a knob that is currently not disabled
- Parameters
-
myname | The name of the knob to search which is currently enabled |
◆ FindFamily()
STATIC KNOB_BASE* KNOB_BASE::FindFamily |
( |
const std::string & |
name | ) |
|
Search for a knob family
- Parameters
-
family | The family of knobs to locate |
◆ FindKnob()
STATIC KNOB_BASE* KNOB_BASE::FindKnob |
( |
const std::string & |
name | ) |
|
Locate a knob from the list of declared knobs
- Parameters
-
myname | The name of the knob to locate |
◆ KNOB_BASE()
KNOB_BASE::KNOB_BASE |
( |
const std::string & |
myprefix, |
|
|
const std::string & |
myname, |
|
|
const std::string & |
myfamily, |
|
|
const std::string & |
mydefault, |
|
|
const std::string & |
mypurpose, |
|
|
KNOB_MODE |
mymode = KNOB_MODE_WRITEONCE |
|
) |
| |
Create a new knob
- Parameters
-
myname | Name of the knob |
myfamily | Family to which the knob belongs to |
mydefault | The default value to which the knob is initialized with |
mypurpose | A string that explains the purpose of the knob |
mymode | KNOB_MODE |
◆ NumberOfKnobs()
STATIC UINT32 KNOB_BASE::NumberOfKnobs |
( |
| ) |
|
- Returns
- The total number of knobs that have been declared
◆ SetByUser()
BOOL KNOB_BASE::SetByUser |
( |
| ) |
const |
- Returns
- TRUE if the user set the knob from command line, FALSE otherwise.
◆ StringKnobSummary()
STATIC std::string KNOB_BASE::StringKnobSummary |
( |
| ) |
|
Print out a summary of all the knobs declared:
- The maximum line length in the print is 116
- If the line exceeds the maximum length of the line, the line will be cut at the last space before the 116th character
- If no space is found the line will be cut at the maximum length, which is 110
◆ StringLongAll()
STATIC std::string KNOB_BASE::StringLongAll |
( |
| ) |
|
◆ TurnOnSetByUser()
VOID KNOB_BASE::TurnOnSetByUser |
( |
| ) |
|
Mark that this knob was set from command line.
◆ KnobSlowAsserts
KNOB< BOOL > KnobSlowAsserts |
Knob for deciding whether using expensive sanity checks.