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

Enable arm64 unwinding with frame pointers #1805

Merged
merged 1 commit into from
Jun 29, 2023

Conversation

javierhonduco
Copy link
Contributor

@javierhonduco javierhonduco commented Jun 28, 2023

This commit adds support for unwinding with frame pointers in arm64,
such as Golang applications, or other native appliactions that have been
compiled with frame pointers (including all of its dynamic and static
dependencies).

To accomplish this, we needed per-architecture vmlinux definitions, that
have been generated with https://github.com/javierhonduco/kernel-build,
running make sh and make dump-btf-configs once inside of the
container.

Some other bits a and bobs that also changed:

  • Removal of the hard checks on arm64, as well as disabling DWARF-based unwinding
    when running in this architecture;
  • The flag to disable DWARF unwinding bit rot, too, so this fixes it;

Note that this is still experimental, we will continue testing this over
the next couple of days. If you find any bugs, let us know!

Test Plan

arm64 machine (M1 Pro)

level=info name=parca-agent ts=2023-06-28T14:17:12.248219087Z caller=main.go:272 msg="ARM64 support is currently in beta. DWARF-based unwinding is not supported yet, see https://github.com/parca-dev/parca-agent/discussions/1376 for more details"
ooooooooo.                                                  .o.                                            .
`888   `Y88.                                               .888.                                         .o8
 888   .d88'  .oooo.   oooo d8b  .ooooo.   .oooo.         .8"888.      .oooooooo  .ooooo.  ooo. .oo.   .o888oo
 888ooo88P'  `P  )88b  `888""8P d88' `"Y8 `P  )88b       .8' `888.    888' `88b  d88' `88b `888P"Y88b    888
 888          .oP"888   888     888        .oP"888      .88ooo8888.   888   888  888ooo888  888   888    888
 888         d8(  888   888     888   .o8 d8(  888     .8'     `888.  `88bod8P'  888    .o  888   888    888 .
o888o        `Y888""8o d888b    `Y8bod8P' `Y888""8o   o88o     o8888o `8oooooo.  `Y8bod8P' o888o o888o   "888"
                                                                      d"     YD
                                                                      "Y88888P'

level=info name=parca-agent ts=2023-06-28T14:17:12.249002843Z caller=main.go:323 msg="maxprocs: Leaving GOMAXPROCS=4: CPU quota undefined"
level=info name=parca-agent ts=2023-06-28T14:17:12.258634042Z caller=main.go:390 msg="eBPF is supported and enabled by the host kernel"
name=parca-agent ts=2023-06-28T14:17:12.266254476Z caller=main.go:510 msg=starting... node=lima-fedora-linux store=grpc.polarsignals.com:443
level=info name=parca-agent ts=2023-06-28T14:17:12.299069811Z caller=cpu.go:239 component=cpu_profiler msg="Attempting to create unwind shards" count=5
^Clevel=warn name=parca-agent ts=2023-06-28T14:17:13.103454119Z caller=discovery_manager.go:196 msg="unable to start provider" provider=systemd/0 error="context canceled"
level=error name=parca-agent ts=2023-06-28T14:17:13.105036507Z caller=main.go:333 err="received signal interrupt"

https://pprof.me/845fdd9

x86_64 machine

Works as expected (kernel tests + integration tests have our backs in
CI)

@javierhonduco javierhonduco force-pushed the enable-arm64-unwinding-with-fp branch 3 times, most recently from 53711cb to c7c23b7 Compare June 29, 2023 10:13
@javierhonduco javierhonduco marked this pull request as ready for review June 29, 2023 10:27
@javierhonduco javierhonduco requested a review from a team as a code owner June 29, 2023 10:27
@javierhonduco javierhonduco force-pushed the enable-arm64-unwinding-with-fp branch 2 times, most recently from 482773c to 285a89a Compare June 29, 2023 11:39
This commit adds support for unwinding with frame pointers in arm64,
such as Golang applications, or other native appliactions that have been
compiled with frame pointers (including all of its dynamic and static
dependencies).

To accomplish this, we needed per-architecture vmlinux definitions, that
have been generated with https://github.com/javierhonduco/kernel-build,
running `make sh` and `make dump-btf-configs` once inside of the
container.

Some other bits a and bobs that also changed:
- Removal of the hard checks on arm64, as well as disabling DWARF-based unwinding
when running in this architecture;
- The flag to disable DWARF unwinding bit rot, too, so this fixes it;

Note that this is still experimental, we will continue testing this over
the next couple of days. If you find any bugs, let us know!

Test Plan
=========

**arm64 machine (M1 Pro)**

```
level=info name=parca-agent ts=2023-06-28T14:17:12.248219087Z caller=main.go:272 msg="ARM64 support is currently in beta. DWARF-based unwinding is not supported yet, see #1376 for more details"
ooooooooo.                                                  .o.                                            .
`888   `Y88.                                               .888.                                         .o8
 888   .d88'  .oooo.   oooo d8b  .ooooo.   .oooo.         .8"888.      .oooooooo  .ooooo.  ooo. .oo.   .o888oo
 888ooo88P'  `P  )88b  `888""8P d88' `"Y8 `P  )88b       .8' `888.    888' `88b  d88' `88b `888P"Y88b    888
 888          .oP"888   888     888        .oP"888      .88ooo8888.   888   888  888ooo888  888   888    888
 888         d8(  888   888     888   .o8 d8(  888     .8'     `888.  `88bod8P'  888    .o  888   888    888 .
o888o        `Y888""8o d888b    `Y8bod8P' `Y888""8o   o88o     o8888o `8oooooo.  `Y8bod8P' o888o o888o   "888"
                                                                      d"     YD
                                                                      "Y88888P'

level=info name=parca-agent ts=2023-06-28T14:17:12.249002843Z caller=main.go:323 msg="maxprocs: Leaving GOMAXPROCS=4: CPU quota undefined"
level=info name=parca-agent ts=2023-06-28T14:17:12.258634042Z caller=main.go:390 msg="eBPF is supported and enabled by the host kernel"
name=parca-agent ts=2023-06-28T14:17:12.266254476Z caller=main.go:510 msg=starting... node=lima-fedora-linux store=grpc.polarsignals.com:443
level=info name=parca-agent ts=2023-06-28T14:17:12.299069811Z caller=cpu.go:239 component=cpu_profiler msg="Attempting to create unwind shards" count=5
^Clevel=warn name=parca-agent ts=2023-06-28T14:17:13.103454119Z caller=discovery_manager.go:196 msg="unable to start provider" provider=systemd/0 error="context canceled"
level=error name=parca-agent ts=2023-06-28T14:17:13.105036507Z caller=main.go:333 err="received signal interrupt"
```

https://pprof.me/845fdd9

**x86_64 machine**

Works as expected (kernel tests + integration tests have our backs in
CI)

Signed-off-by: Francisco Javier Honduvilla Coto <javierhonduco@gmail.com>
@javierhonduco javierhonduco force-pushed the enable-arm64-unwinding-with-fp branch from 285a89a to 325aefc Compare June 29, 2023 11:39
@javierhonduco javierhonduco merged commit 9f6546a into main Jun 29, 2023
22 checks passed
@brancz brancz deleted the enable-arm64-unwinding-with-fp branch June 29, 2023 12:52
jackkleeman added a commit to restatedev/restate that referenced this pull request Jul 6, 2023
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.

None yet

2 participants