coredump: enable cgo warnings#613
Conversation
a013733 to
e88a47c
Compare
| #cgo CFLAGS: -Wno-unused-label | ||
| #cgo CFLAGS: -Wno-sign-compare | ||
| #cgo CFLAGS: -Wno-unknown-pragmas | ||
| #cgo CFLAGS: -Wno-unused-parameter |
There was a problem hiding this comment.
Unfortunately can not enable this one in cgo because of golang/go#71225
There was a problem hiding this comment.
# 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
This reverts commit 2174352.
87e233e to
b8e751b
Compare
| #if !defined(TESTING_COREDUMP) | ||
| #pragma unroll 256 | ||
| #endif |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Applied, please take a look.
rockdaboot
left a comment
There was a problem hiding this comment.
Thanks for working on this, LGTM
8ffbb79 to
a21ac05
Compare
| #define _PRAGMA_UNROLL(x) _Pragma(_STR(unroll x)) | ||
| // Macro for loop unrolling. Expands to the appropriate pragma for clang. | ||
| #define UNROLL(N) _PRAGMA_UNROLL(N) |
There was a problem hiding this comment.
could we just?
| #define _PRAGMA_UNROLL(x) _Pragma(_STR(unroll x)) | |
| // Macro for loop unrolling. Expands to the appropriate pragma for clang. | |
| #define UNROLL(N) _PRAGMA_UNROLL(N) | |
| // Macro for loop unrolling. Expands to the appropriate pragma for clang. | |
| #define UNROLL _Pragma(unroll 256) |
the number is maximum unrolled loops, and the largest is in dotnet, so we can use 256 unconditionally.
There was a problem hiding this comment.
We could then just write on all instances UNROLL for () (keep UNROLL on same line with for).
There was a problem hiding this comment.
I don't necessarily like the idea to write UNROLL for on the same line, but lets try and see how it looks and what others think
There was a problem hiding this comment.
clang-format seem to be happy with it
6f7504a to
1cc7b66
Compare
-Wunused-parameterin the ebpf makefile(void).