Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support DWARF v5 #42

Closed
danielocfb opened this issue Dec 27, 2022 · 1 comment
Closed

Support DWARF v5 #42

danielocfb opened this issue Dec 27, 2022 · 1 comment
Assignees

Comments

@danielocfb
Copy link
Collaborator

See subject. Seems to be not implemented currently:

todo!(); // BlazeSym supports only v4 so far.

@ThinkerYzu1
Copy link
Collaborator

ThinkerYzu1 commented Dec 29, 2022

I have a local branch to work on v5. So far, most DIEs are in v4 or earlier versions by default, but I did see some v5 DIEs mixed in the binary. The parser can handle v5 DIEs, although we mark it as todo. However, compilers put some information we need in different attributes when generating v5 DIEs.

We can ignore v5 DIEs as a short-term solution, meaning we will lose v5 information while still using v4 information. It can mitigate the problems of v5. But we definitely need to keep working on v5.

danielocfb pushed a commit to danielocfb/blazesym that referenced this issue May 27, 2023
This change switches the first bit of the DWARF parsing code -- the
symbol collection -- over to using the gimli crate. The existing code
structure is preserved to minimize churn. For that reason, this change
does not attempt to rework the logic inside parse_die_subprogram() and
fix any inadequacies there.

Using gimli we now gain support for DWARF versions v2, v3, and v5,
although that applies only to symbol lookups (because the source code
location support is still using the hand rolled DWARF parser).

Runtime performance is about the same if our benchmark can be considered
representative:

Before:
> test dwarf::parser::tests::debug_info_parse_single_threaded ... bench:  27,510,100 ns/iter (+/- 487,051)
>
> test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured; 56 filtered out; finished in 8.30s

After:
> test dwarf::parser::tests::debug_info_parse_single_threaded ... bench:  28,485,911 ns/iter (+/- 205,511)
>
> test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured; 54 filtered out; finished in 8.60s

Note that these measurements were taken with a slightly adjusted
debug_info_parse_single_threaded benchmark, which works on the same copy
of the program for the sake of consistency.

Also, the numbers were gathered with LTO and -O3 enabled.

Lastly, I tried using the gimli::UnitHeader::entries_tree API, but it
turned out to be consistently (slightly) slower.

Fixes: libbpf#42
Fixes: libbpf#57
Signed-off-by: Daniel Müller <deso@posteo.net>
@d-e-s-o d-e-s-o self-assigned this May 27, 2023
danielocfb pushed a commit to danielocfb/blazesym that referenced this issue May 27, 2023
This change switches the first bit of the DWARF parsing code -- the
symbol collection -- over to using the gimli crate. The existing code
structure is preserved to minimize churn. For that reason, this change
does not attempt to rework the logic inside parse_die_subprogram() and
fix any inadequacies there.

Using gimli we now gain support for DWARF versions v2, v3, and v5,
although that applies only to symbol lookups (because the source code
location support is still using the hand rolled DWARF parser).

Runtime performance is about the same if our benchmark can be considered
representative:

Before:
> test dwarf::parser::tests::debug_info_parse_single_threaded ... bench:  27,510,100 ns/iter (+/- 487,051)
>
> test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured; 56 filtered out; finished in 8.30s

After:
> test dwarf::parser::tests::debug_info_parse_single_threaded ... bench:  28,485,911 ns/iter (+/- 205,511)
>
> test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured; 54 filtered out; finished in 8.60s

Note that these measurements were taken with a slightly adjusted
debug_info_parse_single_threaded benchmark, which works on the same copy
of the program for the sake of consistency.

Also, the numbers were gathered with LTO and -O3 enabled.

Lastly, I tried using the gimli::UnitHeader::entries_tree API, but it
turned out to be consistently (slightly) slower.

Fixes: libbpf#42
Fixes: libbpf#57
Signed-off-by: Daniel Müller <deso@posteo.net>
danielocfb pushed a commit to danielocfb/blazesym that referenced this issue May 27, 2023
This change switches the first bit of the DWARF parsing code -- the
symbol collection -- over to using the gimli crate. The existing code
structure is preserved to minimize churn. For that reason, this change
does not attempt to rework the logic inside parse_die_subprogram() and
fix any inadequacies there.

Using gimli we now gain support for DWARF versions v2, v3, and v5,
although that applies only to symbol lookups (because the source code
location support is still using the hand rolled DWARF parser).

Runtime performance is about the same if our benchmark can be considered
representative:

Before:
> test dwarf::parser::tests::debug_info_parse_single_threaded ... bench:  27,510,100 ns/iter (+/- 487,051)
>
> test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured; 56 filtered out; finished in 8.30s

After:
> test dwarf::parser::tests::debug_info_parse_single_threaded ... bench:  28,485,911 ns/iter (+/- 205,511)
>
> test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured; 54 filtered out; finished in 8.60s

Note that these measurements were taken with a slightly adjusted
debug_info_parse_single_threaded benchmark, which works on the same copy
of the program for the sake of consistency.

Also, the numbers were gathered with LTO and -O3 enabled.

Lastly, I tried using the gimli::UnitHeader::entries_tree API, but it
turned out to be consistently (slightly) slower.

Fixes: libbpf#42
Fixes: libbpf#57
Signed-off-by: Daniel Müller <deso@posteo.net>
danielocfb pushed a commit to danielocfb/blazesym that referenced this issue May 27, 2023
This change switches the first bit of the DWARF parsing code -- the
symbol collection -- over to using the gimli crate. The existing code
structure is preserved to minimize churn. For that reason, this change
does not attempt to rework the logic inside parse_die_subprogram() and
fix any inadequacies there.

Using gimli we now gain support for DWARF versions v2, v3, and v5,
although that applies only to symbol lookups (because the source code
location support is still using the hand rolled DWARF parser).

Runtime performance is about the same if our benchmark can be considered
representative:

Before:
> test dwarf::parser::tests::debug_info_parse_single_threaded ... bench:  27,510,100 ns/iter (+/- 487,051)
>
> test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured; 56 filtered out; finished in 8.30s

After:
> test dwarf::parser::tests::debug_info_parse_single_threaded ... bench:  28,485,911 ns/iter (+/- 205,511)
>
> test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured; 54 filtered out; finished in 8.60s

Note that these measurements were taken with a slightly adjusted
debug_info_parse_single_threaded benchmark, which works on the same copy
of the program for the sake of consistency.

Also, the numbers were gathered with LTO and -O3 enabled.

Lastly, I tried using the gimli::UnitHeader::entries_tree API, but it
turned out to be consistently (slightly) slower.

Fixes: libbpf#42
Fixes: libbpf#57
Signed-off-by: Daniel Müller <deso@posteo.net>
danielocfb pushed a commit to danielocfb/blazesym that referenced this issue May 30, 2023
This change switches the first bit of the DWARF parsing code -- the
symbol collection -- over to using the gimli crate. The existing code
structure is preserved to minimize churn. For that reason, this change
does not attempt to rework the logic inside parse_die_subprogram() and
fix any inadequacies there.

Using gimli we now gain support for DWARF versions v2, v3, and v5,
although that applies only to symbol lookups (because the source code
location support is still using the hand rolled DWARF parser).

Runtime performance is about the same if our benchmark can be considered
representative:

Before:
> test dwarf::parser::tests::debug_info_parse_single_threaded ... bench:  27,510,100 ns/iter (+/- 487,051)
>
> test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured; 56 filtered out; finished in 8.30s

After:
> test dwarf::parser::tests::debug_info_parse_single_threaded ... bench:  28,485,911 ns/iter (+/- 205,511)
>
> test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured; 54 filtered out; finished in 8.60s

Note that these measurements were taken with a slightly adjusted
debug_info_parse_single_threaded benchmark, which works on the same copy
of the program for the sake of consistency.

Also, the numbers were gathered with LTO and -O3 enabled.

Lastly, I tried using the gimli::UnitHeader::entries_tree API, but it
turned out to be consistently (slightly) slower.

Fixes: libbpf#42
Fixes: libbpf#57
Signed-off-by: Daniel Müller <deso@posteo.net>
danielocfb pushed a commit to danielocfb/blazesym that referenced this issue May 30, 2023
This change switches the first bit of the DWARF parsing code -- the
symbol collection -- over to using the gimli crate. The existing code
structure is preserved to minimize churn. For that reason, this change
does not attempt to rework the logic inside parse_die_subprogram() and
fix any inadequacies there.

Using gimli we now gain support for DWARF versions v2, v3, and v5,
although that applies only to symbol lookups (because the source code
location support is still using the hand rolled DWARF parser).

Runtime performance is about the same if our benchmark can be considered
representative:

Before:
> test dwarf::parser::tests::debug_info_parse_single_threaded ... bench:  27,510,100 ns/iter (+/- 487,051)
>
> test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured; 56 filtered out; finished in 8.30s

After:
> test dwarf::parser::tests::debug_info_parse_single_threaded ... bench:  28,485,911 ns/iter (+/- 205,511)
>
> test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured; 54 filtered out; finished in 8.60s

Note that these measurements were taken with a slightly adjusted
debug_info_parse_single_threaded benchmark, which works on the same copy
of the program for the sake of consistency.

Also, the numbers were gathered with LTO and -O3 enabled.

Lastly, I tried using the gimli::UnitHeader::entries_tree API, but it
turned out to be consistently (slightly) slower.

Closes: libbpf#42
Closes: libbpf#57
Signed-off-by: Daniel Müller <deso@posteo.net>
danielocfb pushed a commit to danielocfb/blazesym that referenced this issue May 31, 2023
This change switches the first bit of the DWARF parsing code -- the
symbol collection -- over to using the gimli crate. The existing code
structure is preserved to minimize churn. For that reason, this change
does not attempt to rework the logic inside parse_die_subprogram() and
fix any inadequacies there.

Using gimli we now gain support for DWARF versions v2, v3, and v5,
although that applies only to symbol lookups (because the source code
location support is still using the hand rolled DWARF parser).

Runtime performance is about the same if our benchmark can be considered
representative:

Before:
> test dwarf::parser::tests::debug_info_parse_single_threaded ... bench:  27,510,100 ns/iter (+/- 487,051)
>
> test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured; 56 filtered out; finished in 8.30s

After:
> test dwarf::parser::tests::debug_info_parse_single_threaded ... bench:  28,485,911 ns/iter (+/- 205,511)
>
> test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured; 54 filtered out; finished in 8.60s

Note that these measurements were taken with a slightly adjusted
debug_info_parse_single_threaded benchmark, which works on the same copy
of the program for the sake of consistency.

Also, the numbers were gathered with LTO and -O3 enabled.

Lastly, I tried using the gimli::UnitHeader::entries_tree API, but it
turned out to be consistently (slightly) slower.

Closes: libbpf#42
Closes: libbpf#57
Signed-off-by: Daniel Müller <deso@posteo.net>
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

No branches or pull requests

3 participants