Skip to content

refactor: apply const to bpf variables #1341

Merged
mmat11 merged 4 commits into
open-telemetry:mainfrom
coralogix:pgn/consts
Feb 23, 2026
Merged

refactor: apply const to bpf variables #1341
mmat11 merged 4 commits into
open-telemetry:mainfrom
coralogix:pgn/consts

Conversation

@pinoOgni
Copy link
Copy Markdown
Contributor

This is the first phase of what I hope will be a larger refactoring.
This PR updates variable declarations to use the const across the following bpf directories:

  • bpf/gotracer
  • bpf/common
  • bpf/generictracer

Add const is a best practice that offers various benefits like readability, intent and safety. It should also add compiler optimization and help the verifier.

I find the code much more readable this way, I hope it works for you.

@pinoOgni pinoOgni requested a review from a team as a code owner February 20, 2026 20:26
Copy link
Copy Markdown
Contributor

@rafaelroquetto rafaelroquetto left a comment

Choose a reason for hiding this comment

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

Yes! Thank you so so much for this!!!!
I will see if I can find a linter to help us enforce this moving forward. This is great!

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.76%. Comparing base (b16912d) to head (e5c90ab).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1341   +/-   ##
=======================================
  Coverage   43.75%   43.76%           
=======================================
  Files         308      308           
  Lines       33497    33497           
=======================================
+ Hits        14658    14661    +3     
+ Misses      17896    17894    -2     
+ Partials      943      942    -1     
Flag Coverage Δ
integration-test 21.67% <ø> (+0.04%) ⬆️
integration-test-arm 0.00% <ø> (ø)
integration-test-vm-x86_64-5.15.152 0.00% <ø> (ø)
integration-test-vm-x86_64-6.10.6 0.00% <ø> (ø)
k8s-integration-test 2.34% <ø> (ø)
oats-test 0.00% <ø> (ø)
unittests 44.60% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread bpf/common/dns.h Outdated
Comment thread bpf/generictracer/k_tracer.c Outdated
Copy link
Copy Markdown
Contributor

@mmat11 mmat11 left a comment

Choose a reason for hiding this comment

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

can be merged after rebase

Comment thread bpf/common/dns.h Outdated
Comment thread bpf/common/trace_common.h Outdated
Signed-off-by: Giuseppe Ognibene <giuseppe.ognibene@coralogix.com>
Signed-off-by: Giuseppe Ognibene <giuseppe.ognibene@coralogix.com>
Signed-off-by: Giuseppe Ognibene <giuseppe.ognibene@coralogix.com>
Signed-off-by: Giuseppe Ognibene <giuseppe.ognibene@coralogix.com>
@mmat11 mmat11 merged commit 20b50cb into open-telemetry:main Feb 23, 2026
96 of 101 checks passed
@mmat11 mmat11 deleted the pgn/consts branch February 23, 2026 17:14
@MrAlias MrAlias added this to the v0.6.0 milestone Feb 23, 2026
@MrAlias MrAlias mentioned this pull request Mar 5, 2026
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.

4 participants