omnitrace-run executable - required for running binary writes (#257)
* omnitrace-run exe
- ensure LD_PRELOAD for libomnitrace-dl.so
- convert config options into command-line options
* Update timemory submodule
- updates to tsettings
- updates to argparser
* common environment update
- throw error if get_env<bool> has empty string
* config updates
- minor tweaks to categories of settings
* core lib update
- add argparse for common handling of argument parsers
* omnitrace-sample update
- fix handling of --trace-file (OMNITRACE_PERFETTO_FILE)
* omnitrace-run update
- updated to use omnitrace::argparse functions
* Tests for omnitrace-run
* argparse core update
- remove choices for --cpu-events and --gpu-events
* remove some debugging prints
* fix timemory include in argparse.cpp
* always provide --hsa-interrupt option
* Update source/lib/core/argparse.cpp
- fix pedantic warning
* Update testing
- remove testing args that may not be there in some builds
* roctracer/pthread_create fix
- disable roctracer_data when roctracer not enabled
* omnitrace-causal tweak
* omnitrace-instrument: module_function tweak
- allow DEFAULT_MODULE and LIBRARY_MODULE
* common environment update
- support get_env for enums
* core: config update
- Add "mode" category to OMNITRACE_MODE
* Update timemory submodule
- remove debug print statement
* omnitrace-sample tweak
- change var init
* omnitrace-run testing update
- use --help instead of -?
* core: common.hpp
- tweak header include style
* core: argparser update
- add_ld_preload func
- launcher and command member variables in parser_data
- support launcher
* omnitrace-run update
- clean up and reworked
* libomnitrace-dl updates
- require LD_PRELOAD with binary rewrite
- dl::InstrumentMode
- dl::get_instrumented()
- verify_instrumented_preloaded()
- omnitrace_set_instrumented(int)
- relocated omnitrace_main from main.c to dl.cpp
- omnitrace_set_env does not dlopen libomnitrace
- omnitrace_set_main(func_ptr) [internal API]
- OMNITRACE_HIDDEN_API -> OMNITRACE_INTERNAL_API
* Update testing to new LD_PRELOAD requirements
* omnitrace-instrument updates
- adhere to LD_PRELOAD requirementsa
- invoke omnitrace_set_instrumented
- binary rewrite does not instrument main
- binary rewrite does not instrument call to omnitrace_init
- runtime instr does not instrument main
- runtime instr does not instrument call to omnitrace_init
* Bump to v1.9.0
- LD_PRELOAD requirement necessitates minor version increment
* common: environment
- fix ambiguous get_env calls
* omnitrace-instrument update
- fix issue with temporaries
* omnitrace-instrument and libomnitrace-dl updates
- runtime instrumentation does not work if libomnitrace-dl is preloaded
* libomnitrace-dl and libpyomnitrace updates
- define dl::InstrumentMode in dl.hpp
- handle instrumentation via setprofile libpyomnitrace
- do not push trace in omnitrace_init
* omnitrace-instrument and libomnitrace-dl updates
- move header to dl subdirectory
- omnitrace::omnitrace-headers include omnitrace-dl folder
- use InstrumentMode in omnitrace-instrument
* Update workflows and scripts
- Use omnitrace-run on instrumented exes
* Update docs
- add omnitrace-run to examples of running binary rewritten exes
[ROCm/rocprofiler-systems commit: abe35de43a]
このコミットが含まれているのは:
@@ -97,7 +97,7 @@ e.g., omnitrace's meaning of the term "module" when instrumenting Python.
|
||||
- Binary rewrites only instrument the functions defined in the target binary, whereas runtime instrumentation can/will instrument functions defined in the shared libraries which are linked into the target binary
|
||||
- When using binary instrumentation with MPI, avoid runtime instrumentation
|
||||
- Runtime instrumentation requires a fork + ptrace: which is generally incompatible with how MPI applications spawn their processes
|
||||
- Binary rewrite the executable using MPI (and, optionally, libraries used by the executable) and execute the generated instrumented executable instead of the original, e.g. `mpirun -n 2 ./myexe` should be `mpirun -n 2 ./myexe.inst` where `myexe.inst` is the generated instrumented `myexe` executable.
|
||||
- Binary rewrite the executable using MPI (and, optionally, libraries used by the executable) and execute the generated instrumented executable via `omnitrace-run` instead of the original, e.g. `mpirun -n 2 ./myexe` should be `mpirun -n 2 omnitrace-run -- ./myexe.inst` where `myexe.inst` is the generated instrumented `myexe` executable.
|
||||
|
||||
## Data Collection Mode(s)
|
||||
|
||||
|
||||
@@ -335,7 +335,7 @@ is consistent with the LLVM style of using a standalone double-hyphen (`--`). Al
|
||||
are interpreted as belonging to omnitrace and all arguments following the double-hyphen are interpreted as the
|
||||
application and it's arguments. In binary rewrite mode, all application arguments after the first argument
|
||||
are ignored, i.e. `./omnitrace-instrument -o ls.inst -- ls -l` interprets `ls` as the target to instrument (ignores the `-l` argument)
|
||||
and generates a `ls.inst` executable that you can subsequently run `ls.inst -l` with.
|
||||
and generates a `ls.inst` executable that you can subsequently run `omnitrace-run -- ls.inst -l` with.
|
||||
|
||||
## Runtime Instrumentation
|
||||
|
||||
@@ -781,7 +781,7 @@ For example, if the following sequence of commands are run:
|
||||
omnitrace-instrument -o ./foo.inst -- ./foo
|
||||
export OMNITRACE_USE_SAMPLING=ON
|
||||
export OMNITRACE_SAMPLING_FREQ=5
|
||||
./foo.inst
|
||||
omnitrace-run -- ./foo.inst
|
||||
```
|
||||
|
||||
These configuration settings will not be preserved in another session, whereas:
|
||||
@@ -794,7 +794,7 @@ will preserve those environment variables:
|
||||
|
||||
```shell
|
||||
# will sample 5x per second
|
||||
./foo.samp
|
||||
omnitrace-run -- ./foo.samp
|
||||
```
|
||||
|
||||
while still allowing the subsequent session to override those defaults:
|
||||
@@ -802,7 +802,7 @@ while still allowing the subsequent session to override those defaults:
|
||||
```shell
|
||||
# will sample 100x per second
|
||||
export OMNITRACE_SAMPLING_FREQ=100
|
||||
./foo.samp
|
||||
omnitrace-run -- ./foo.samp
|
||||
```
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
@@ -15,7 +15,7 @@ Call-stack sampling can be activated with either a binary instrumented via the `
|
||||
|
||||
```console
|
||||
omnitrace-instrument -M sampling -o foo.inst -- foo
|
||||
./foo.inst
|
||||
omnitrace-run -- ./foo.inst
|
||||
```
|
||||
|
||||
- Runtime instrumentation with only instrumentation necessary to start/stop sampling
|
||||
|
||||
@@ -169,11 +169,7 @@ custom_push_region(const char* name)
|
||||
```console
|
||||
$ omnitrace-instrument -l --min-instructions=8 -E custom_push_region -o -- ./user-api
|
||||
...
|
||||
$ export OMNITRACE_USE_TIMEMORY=ON
|
||||
$ export OMNITRACE_USE_PID=OFF
|
||||
$ export OMNITRACE_TIME_OUTPUT=OFF
|
||||
$ export OMNITRACE_OUTPUT_PATH=omnitrace-example-output
|
||||
$ ./user-api.inst 20 4 100
|
||||
$ omnitrace-run --profile --use-pid off --time-output off -- ./user-api.inst 20 4 100
|
||||
Pushing custom region :: ./user-api.inst
|
||||
[omnitrace][omnitrace_init_tooling] Instrumentation mode: Trace
|
||||
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする