Skip to content

Conversation

@davidlattimore
Copy link
Owner

No description provided.

@marxin
Copy link
Collaborator

marxin commented Jan 10, 2026

Note so far we've been using RUST_LOG=metrics=debug for the metrics:

2026-01-10T21:02:50.946213Z DEBUG metrics: input_sections loaded_bytes=22416 loaded_compressed_bytes=0 decompressed_bytes=0
2026-01-10T21:02:50.947930Z DEBUG metrics: merge_strings section=`.rodata` string_count=177 byte_size=2363 input_string_count=180 input_string_byte_size=2368 output_map_overflow=61
2026-01-10T21:02:50.947975Z DEBUG metrics: merge_strings section=`.comment` string_count=2 byte_size=28 input_string_count=1432 input_string_byte_size=20048 output_map_overflow=0
2026-01-10T21:02:51.076890Z DEBUG metrics: resolved relocations section="`.text`" relocations=939735
2026-01-10T21:02:51.076927Z DEBUG metrics: resolved relocations section="`.init`" relocations=1
2026-01-10T21:02:51.076930Z DEBUG metrics: resolved relocations section="`.data`" relocations=428
2026-01-10T21:02:51.076934Z DEBUG metrics: resolved relocations section="`.tdata`" relocations=1
2026-01-10T21:02:51.076937Z DEBUG metrics: resolved relocations section="`.data.rel.ro`" relocations=55094
2026-01-10T21:02:51.076939Z DEBUG metrics: resolved relocations section="``.fini_array`` (secondary)" relocations=2
2026-01-10T21:02:51.076942Z DEBUG metrics: resolved relocations section="``.init_array`` (secondary)" relocations=429

Our ambition should be to have a unified approach how to present the metrics about a linking invocation.

@davidlattimore
Copy link
Owner Author

Yeah, you're right, it would be best to just have one lot of metrics. I'll have a think about how to proceed, but will probably just close this PR. In the longer run, it might be good to have an easy to remember flag like --stats. I also like how GNU ld's --stats flag can take a filename as an argument and also has an environment variable that if set, writes the stats to the specified file. That allows people to write metrics to a file without needing to adjust the linker command-line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants