-
Notifications
You must be signed in to change notification settings - Fork 166
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
Enabling debug symbols #58
Enabling debug symbols #58
Comments
Are there performance penalties in having debug symbols enabled? |
Yes, I would like to implement the feature in the builder in a backward-compatible way as it suggested in #63 (comment) , but I have no idea who and how use releases issued from this repository. We make private builds of the collector using the builder. I could update builder manifests here too if it would be helpful for users of those releases. |
Generally speaking, no. Debug symbols are used by debugging facilities in cases they required to, for example when a user attach or run process under a debugger or the Linux perf tool. The only effect everyone who don't care about debugging should notice is the growth of the binary size. |
I believe the only place you'd need to change is this:
|
I don't see, how it would help binaries built using the OpenTelemetry builder command line tool. |
Sorry, I missed that part!
This would be the place to remove it: I think we can externalize it in a config property. |
I think this issue is still relevant today. Looking at the builder code, we can override ld flags only when debug compilation property is set to true. Is there a way to only override ld flags? The purpose here is to keep debug symbols and DWARF data without setting those GCflags. |
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description The primary purpose of this PR is to provide greater flexibility in how OTEL binaries are built, enabling the inclusion of debugging symbols when needed, without always stripping them by default. Currently, debugging symbols are only retained when debug_compilation=true. However, this approach also disables all compiler inlining and optimizations (gcflags=all=-N -l) to ensure an exact match between written and executed code, resulting in a significant increase in CPU consumption. There are scenarios where we want binaries with debugging symbols and DWARF information while still allowing the compiler to optimize and inline. This PR addresses that need by introducing configurable GCFlags. `ocb --ldflags="" --gcflags="" --config=builder-config.yaml` <!-- Issue number if applicable --> #### Link to tracking issue Fixes [#58](open-telemetry/opentelemetry-collector-releases#58) <!--Describe what testing was performed and which tests were added.--> #### Testing Manual Override LDflags: ![image](https://github.com/user-attachments/assets/6bcb0f7b-492a-45fb-a232-9c337afb5f5e) Override both ![image](https://github.com/user-attachments/assets/00bc6c5f-37f0-438d-b4e1-f7a2d5833ec9) <!--Describe the documentation added.--> #### Documentation README file updated. -- Backward compatibility concerns: - As of today, passing cfg.LDFlags will append to LD flags that are by default to `-s -w`. Questions: - Should we deprecate DebugCompilation property? <!--Please delete paragraphs that you did not use before submitting.-->
We are contemplating whether to enable debug symbols (disabled by -s -w LDFLAGS on build) on our downstream repo
aws-otel-collector
. We want to be in line with what is being done upstream but it seems that there's an inconsistency. In thisopentelemetry-collector-releases
repo it appears that they are disabled but in opentelemetry-collector-contrib it appears to be enabled.Is there any reason for this inconsistence/any guidance on what we should lean towards regarding enabling/disabling debug symbols?
The text was updated successfully, but these errors were encountered: