2016-02-19 18:32:24 +00:00
|
|
|
## dlv trace
|
|
|
|
|
|
|
|
Compile and begin tracing program.
|
|
|
|
|
|
|
|
### Synopsis
|
|
|
|
|
2016-05-20 17:51:23 +00:00
|
|
|
Trace program execution.
|
|
|
|
|
|
|
|
The trace sub command will set a tracepoint on every function matching the
|
|
|
|
provided regular expression and output information when tracepoint is hit. This
|
|
|
|
is useful if you do not want to begin an entire debug session, but merely want
|
|
|
|
to know what functions your process is executing.
|
2016-02-19 18:32:24 +00:00
|
|
|
|
2020-05-13 06:38:10 +00:00
|
|
|
The output of the trace sub command is printed to stderr, so if you would like to
|
|
|
|
only see the output of the trace operations you can redirect stdout.
|
|
|
|
|
2016-02-19 18:32:24 +00:00
|
|
|
```
|
2021-07-22 18:05:37 +00:00
|
|
|
dlv trace [package] regexp [flags]
|
2016-02-19 18:32:24 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Options
|
|
|
|
|
|
|
|
```
|
2021-07-31 15:16:26 +00:00
|
|
|
--ebpf Trace using eBPF (experimental).
|
2018-10-17 22:06:18 +00:00
|
|
|
-e, --exec string Binary file to exec and trace.
|
2021-07-22 18:05:37 +00:00
|
|
|
-h, --help help for trace
|
2023-05-16 16:36:15 +00:00
|
|
|
--output string Output path for the binary.
|
2018-01-25 19:54:00 +00:00
|
|
|
-p, --pid int Pid to attach to.
|
2022-07-22 15:57:57 +00:00
|
|
|
-s, --stack int Show stack trace with given depth. (Ignored with --ebpf)
|
2018-10-17 22:06:18 +00:00
|
|
|
-t, --test Trace a test binary.
|
2023-05-08 17:41:47 +00:00
|
|
|
--timestamp Show timestamp in the output
|
2016-02-19 18:32:24 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Options inherited from parent commands
|
|
|
|
|
|
|
|
```
|
2023-08-09 17:37:55 +00:00
|
|
|
--backend string Backend selection (see 'dlv help backend'). (default "default")
|
|
|
|
--build-flags string Build flags, to be passed to the compiler. For example: --build-flags="-tags=integration -mod=vendor -cover -v"
|
|
|
|
--check-go-version Exits if the version of Go in use is not compatible (too old or too new) with the version of Delve. (default true)
|
|
|
|
--disable-aslr Disables address space randomization
|
|
|
|
--log Enable debugging server logging.
|
|
|
|
--log-dest string Writes logs to the specified file or file descriptor (see 'dlv help log').
|
|
|
|
--log-output string Comma separated list of components that should produce debug output (see 'dlv help log')
|
|
|
|
-r, --redirect stringArray Specifies redirect rules for target process (see 'dlv help redirect')
|
|
|
|
--wd string Working directory for running the program.
|
2016-02-19 18:32:24 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### SEE ALSO
|
2021-07-22 18:05:37 +00:00
|
|
|
|
2016-02-19 18:32:24 +00:00
|
|
|
* [dlv](dlv.md) - Delve is a debugger for the Go programming language.
|
|
|
|
|