Skip to content

coredump: enable cgo warnings #613

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

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

korniltsev
Copy link
Contributor

@korniltsev korniltsev commented Jul 16, 2025

@korniltsev korniltsev force-pushed the korniltsev/coredump_warnings branch from a013733 to e88a47c Compare July 17, 2025 07:15
#cgo CFLAGS: -Wno-unused-label
#cgo CFLAGS: -Wno-sign-compare
#cgo CFLAGS: -Wno-unknown-pragmas
#cgo CFLAGS: -Wno-unused-parameter
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately can not enable this one in cgo because of golang/go#71225

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# go.opentelemetry.io/ebpf-profiler/tools/coredump
cgo-generated-wrappers: In function '_cgoexp_b173915d1d03___bpf_log':
cgo-generated-wrappers:91:43: error: unused parameter 'p' [-Werror=unused-parameter]
cgo-generated-wrappers: In function '_cgoexp_b173915d1d03___push_frame':
cgo-generated-wrappers:92:46: error: unused parameter 'p' [-Werror=unused-parameter]
cgo-generated-wrappers: In function '_cgoexp_b173915d1d03_bpf_ktime_get_ns':
cgo-generated-wrappers:93:50: error: unused parameter 'p' [-Werror=unused-parameter]
cgo-generated-wrappers: In function '_cgoexp_b173915d1d03_bpf_get_current_comm':
cgo-generated-wrappers:94:54: error: unused parameter 'p' [-Werror=unused-parameter]
cgo-generated-wrappers: In function '_cgoexp_b173915d1d03___bpf_probe_read_user':
cgo-generated-wrappers:95:55: error: unused parameter 'p' [-Werror=unused-parameter]
cgo-generated-wrappers: In function '_cgoexp_b173915d1d03___bpf_map_lookup_elem':
cgo-generated-wrappers:96:55: error: unused parameter 'p' [-Werror=unused-parameter]
cc1: all warnings being treated as errors

@korniltsev korniltsev marked this pull request as ready for review July 17, 2025 07:25
@korniltsev korniltsev requested review from a team as code owners July 17, 2025 07:25
@korniltsev korniltsev force-pushed the korniltsev/coredump_warnings branch from 87e233e to b8e751b Compare July 21, 2025 03:28
@korniltsev korniltsev requested review from florianl and fabled July 21, 2025 03:33
@korniltsev
Copy link
Contributor Author

This should be ready for another round of review

Comment on lines 109 to 111
#if !defined(TESTING_COREDUMP)
#pragma unroll 256
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid code repetition by defining a macro (e.g. UNROLL), which is empty for gcc.
Just in case, https://github.com/open-telemetry/opentelemetry-ebpf-profiler/pull/613/files#r2218507693 can't be solved to use the same compiler everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied, please take a look.

@korniltsev korniltsev requested a review from rockdaboot July 21, 2025 14:57
Copy link
Contributor

@rockdaboot rockdaboot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this, LGTM

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.

5 participants