Skip to content

Fix BPF tests failing because use_task_pt_regs_helper defaults to true#504

Open
gmarler wants to merge 3 commits into
javierhonduco:mainfrom
gmarler:bpf_task_pt_regs-test-fix
Open

Fix BPF tests failing because use_task_pt_regs_helper defaults to true#504
gmarler wants to merge 3 commits into
javierhonduco:mainfrom
gmarler:bpf_task_pt_regs-test-fix

Conversation

@gmarler

@gmarler gmarler commented Jul 1, 2026

Copy link
Copy Markdown
Contributor
  • Fix the tests that fail because use_task_pt_regs_helper defaults to true
  • Once those pass, subsequent integration tests fail on RHEL 8.10 - fix those

@gmarler

gmarler commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Now that those tests pass, the following fail:

failures:

---- test_use_pt_regs_helper stdout ----

thread 'test_use_pt_regs_helper' (190377) panicked at src/bpf_objects.rs:70:66:
load skel: Error: Invalid argument (os error 22)

---- test_do_not_use_pt_regs_helper stdout ----

thread 'test_do_not_use_pt_regs_helper' (190374) panicked at src/bpf_objects.rs:70:66:
load skel: Error: Invalid argument (os error 22)

---- test_integration_ocaml_native_defaults stdout ----

thread 'test_integration_ocaml_native_defaults' (190376) panicked at src/bpf_objects.rs:70:66:
load skel: Error: Invalid argument (os error 22)

---- test_integration stdout ----

thread 'test_integration' (190375) panicked at src/bpf_objects.rs:70:66:
load skel: Error: Invalid argument (os error 22)


failures:
    test_do_not_use_pt_regs_helper
    test_integration
    test_integration_ocaml_native_defaults
    test_use_pt_regs_helper

- test_integration and test_integration_ocaml_native_defaults: now set
  use_task_pt_regs_helper from system_info, matching what the production binary
  does
- test_use_pt_regs_helper: returns early on kernels without the helper
- test_do_not_use_pt_regs_helper: start with true instead of false
@gmarler

gmarler commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

With that commit, the integration tests pass again on a live RHEL 8.10 box too.

Comment thread src/profiler.rs
..ProfilerConfig::default()
},
stop_signal_receive,
metadata_provider,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Why not using ..Profiler::Default() like you did above for the config?

@gmarler gmarler Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, that's because here we're not overriding ProfilerConfig::default() (alone) like I did above, but I'm overriding Profiler::default() instead - because that's what the test is using.

And the only way I know of to do that in Rust is not to call Profiler::Default() at all, but to call Profiler::new() with the same ProfilerConfig::default() override as I did above - plus the other arguments Profiler::new() needs.

Am I missing something?

Comment thread tests/integration_test.rs
Comment thread tests/integration_test.rs

@javierhonduco javierhonduco left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Minor comments, LGTM overall

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.

2 participants