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

Enabling debug symbols #58

Open
aateeqi opened this issue Jan 14, 2022 · 8 comments · May be fixed by open-telemetry/opentelemetry-collector#11996
Open

Enabling debug symbols #58

aateeqi opened this issue Jan 14, 2022 · 8 comments · May be fixed by open-telemetry/opentelemetry-collector#11996

Comments

@aateeqi
Copy link
Contributor

aateeqi commented Jan 14, 2022

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 this opentelemetry-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?

@jpkrohling
Copy link
Member

Are there performance penalties in having debug symbols enabled?

@jpkrohling
Copy link
Member

@kaero, @aateeqi, would you be open to opening a PR for this?

@kaero
Copy link

kaero commented Jan 25, 2022

@jpkrohling

@kaero, @aateeqi, would you be open to opening a PR for this?

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.

@kaero
Copy link

kaero commented Jan 25, 2022

Are there performance penalties in having debug symbols enabled?

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.

@jpkrohling
Copy link
Member

I believe the only place you'd need to change is this:

Ldflags: []string{"-s", "-w"},

@kaero
Copy link

kaero commented Jan 25, 2022

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.

@jpkrohling
Copy link
Member

Sorry, I missed that part!

We make private builds of the collector using the builder.

This would be the place to remove it:
https://github.com/open-telemetry/opentelemetry-collector/blob/88e9c86f2d32c224a488a5a4935cdafcafc5b943/cmd/builder/internal/builder/main.go#L89

I think we can externalize it in a config property.

@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Jul 16, 2024
@dosubot dosubot bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 23, 2024
@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Jul 23, 2024
@mx-psi mx-psi reopened this Jul 23, 2024
@Dainerx
Copy link

Dainerx commented Dec 18, 2024

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.

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 a pull request may close this issue.

5 participants