What level of cargo debug info does samply need?
I noticed full debug with cargo can be large, in our case, they are almost 1GB. OTOH, using `debug = "line-tables-only"` is much smaller, but also shows a slightly different name resolution.
I was wondering if samply has guidance on what options to use that allow profiling and ideally storing profiling binaries for reproducibility, without creating excessively large files?
The builds, with line-tables-only, with full debug and in release mode:
```
$ du -h target/*/uv
360M target/profiling2/uv
986M target/profiling/uv
54M target/release/uv
```
---
The two slightly different profiles:
**full** https://share.firefox.dev/4dAwjBY
<img width="1449" height="598" alt="Image" src="https://github.com/user-attachments/assets/ae8a3983-6a91-42ab-aa9b-9e599a96b758" />
**line-tables-only** https://share.firefox.dev/4bFmgcu
<img width="1449" height="598" alt="Image" src="https://github.com/user-attachments/assets/1f3bc2f5-cacb-4663-9aa8-c6e3122117e7" />
---
From the cargo docs on the different debuginfo options (https://doc.rust-lang.org/rustc/codegen-options/index.html#debuginfo):
> This flag controls the generation of debug information. It takes one of the
following values:
>
> * `0` or `none`: no debug info at all (the default).
> * `line-directives-only`: line info directives only. For the nvptx* targets this enables [profiling](https://reviews.llvm.org/D46061). For other use cases, `line-tables-only` is the better, more compatible choice.
> * `line-tables-only`: line tables only. Generates the minimal amount of debug info for backtraces with filename/line number info, but not anything else, i.e. no variable or function parameter info.
> * `1` or `limited`: debug info without type or variable-level information.
> * `2` or `full`: full debug info.
>
> Note: The [`-g` flag][option-g-debug] is an alias for `-C debuginfo=2`.
2 条评论