mirror of
https://github.com/intel/llvm.git
synced 2026-01-21 20:53:29 +08:00
[DOCS] Add instrumentation instructions to README
Summary: Add basic instructions on how to instrument a binary. (cherry picked from FBD24660183)
This commit is contained in:
committed by
Maksim Panchenko
parent
eb12d719ac
commit
3e78082c1b
@@ -19,49 +19,48 @@
|
||||
using namespace llvm;
|
||||
|
||||
namespace opts {
|
||||
extern cl::OptionCategory BoltCategory;
|
||||
extern cl::OptionCategory BoltInstrCategory;
|
||||
|
||||
cl::opt<std::string> InstrumentationFilename(
|
||||
"instrumentation-file",
|
||||
cl::desc("file name where instrumented profile will be saved"),
|
||||
cl::init("/tmp/prof.fdata"),
|
||||
cl::Optional,
|
||||
cl::cat(BoltCategory));
|
||||
cl::desc("file name where instrumented profile will be saved (default: "
|
||||
"/tmp/prof.fdata)"),
|
||||
cl::init("/tmp/prof.fdata"), cl::Optional, cl::cat(BoltInstrCategory));
|
||||
|
||||
cl::opt<bool> InstrumentationFileAppendPID(
|
||||
"instrumentation-file-append-pid",
|
||||
cl::desc("append PID to saved profile file name (default: false)"),
|
||||
cl::init(false),
|
||||
cl::Optional,
|
||||
cl::cat(BoltCategory));
|
||||
cl::cat(BoltInstrCategory));
|
||||
|
||||
cl::opt<bool> ConservativeInstrumentation(
|
||||
"conservative-instrumentation",
|
||||
cl::desc(
|
||||
"don't trust our CFG and disable spanning trees and any counter "
|
||||
"inference, put a counter everywhere (for debugging, default: false)"),
|
||||
cl::init(false), cl::Optional, cl::cat(BoltCategory));
|
||||
cl::init(false), cl::Optional, cl::cat(BoltInstrCategory));
|
||||
|
||||
cl::opt<uint32_t>
|
||||
InstrumentationSleepTime("instrumentation-sleep-time",
|
||||
cl::desc("interval between profile writes, "
|
||||
"default: 0 = write only at program end"),
|
||||
cl::init(0), cl::Optional,
|
||||
cl::cat(BoltCategory));
|
||||
cl::opt<uint32_t> InstrumentationSleepTime(
|
||||
"instrumentation-sleep-time",
|
||||
cl::desc("interval between profile writes (default: 0 = write only at "
|
||||
"program end). This is useful for service workloads when you "
|
||||
"want to dump profile every X minutes or if you are killing the "
|
||||
"program and the profile is not being dumped at the end."),
|
||||
cl::init(0), cl::Optional, cl::cat(BoltInstrCategory));
|
||||
|
||||
cl::opt<bool> InstrumentHotOnly(
|
||||
"instrument-hot-only",
|
||||
cl::desc("only insert instrumentation on hot functions (need profile)"),
|
||||
cl::init(false),
|
||||
cl::Optional,
|
||||
cl::cat(BoltCategory));
|
||||
cl::opt<bool>
|
||||
InstrumentHotOnly("instrument-hot-only",
|
||||
cl::desc("only insert instrumentation on hot functions "
|
||||
"(needs profile, default: false)"),
|
||||
cl::init(false), cl::Optional,
|
||||
cl::cat(BoltInstrCategory));
|
||||
|
||||
cl::opt<bool> InstrumentCalls(
|
||||
"instrument-calls",
|
||||
cl::desc("record profile for inter-function control flow activity"),
|
||||
cl::init(true),
|
||||
cl::Optional,
|
||||
cl::cat(BoltCategory));
|
||||
cl::opt<bool> InstrumentCalls("instrument-calls",
|
||||
cl::desc("record profile for inter-function "
|
||||
"control flow activity (default: true)"),
|
||||
cl::init(true), cl::Optional,
|
||||
cl::cat(BoltInstrCategory));
|
||||
}
|
||||
|
||||
namespace llvm {
|
||||
|
||||
@@ -45,10 +45,12 @@ cl::OptionCategory BoltOptCategory("BOLT optimization options");
|
||||
cl::OptionCategory BoltRelocCategory("BOLT options in relocation mode");
|
||||
cl::OptionCategory BoltOutputCategory("Output options");
|
||||
cl::OptionCategory AggregatorCategory("Data aggregation options");
|
||||
cl::OptionCategory BoltInstrCategory("BOLT instrumentation options");
|
||||
|
||||
static cl::OptionCategory *BoltCategories[] = {&BoltCategory,
|
||||
&BoltOptCategory,
|
||||
&BoltRelocCategory,
|
||||
&BoltInstrCategory,
|
||||
&BoltOutputCategory};
|
||||
|
||||
static cl::OptionCategory *BoltDiffCategories[] = {&BoltDiffCategory};
|
||||
|
||||
Reference in New Issue
Block a user