Skip to content

Conversation

@SRodi
Copy link
Member

@SRodi SRodi commented Nov 4, 2025

Description

Adds a check for /proc/sys/kernel/ftrace_enabled before deciding to use fexit eBPF programs. When ftrace is disabled, the plugin will fall back to kprobes.

Changes

  • Added IsFtraceEnabled() helper function in pkg/plugin/common/common_linux.go that reads /proc/sys/kernel/ftrace_enabled
  • Updated getEbpfPayload() to check ftrace status and log it
  • Modified resolvePayload() to accept ftraceEnabled parameter and only use fexit programs when ftrace is enabled (in addition to existing kernel version/architecture requirements)
  • Updated documentation to clarify that fexit programs require ftrace to be enabled

Behavior

  • Before: Plugin would attempt to use fexit programs based only on kernel version and architecture, potentially failing when ftrace is disabled
  • After: Plugin checks ftrace status and gracefully falls back to kprobes when ftrace is disabled

Related Issue

If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request.

Checklist

  • I have read the contributing documentation.
  • I signed and signed-off the commits (git commit -S -s ...). See this documentation on signing commits.
  • I have correctly attributed the author(s) of the code.
  • I have tested the changes locally.
  • I have followed the project's style guidelines.
  • I have updated the documentation, if necessary.
  • I have added tests, if applicable.

Screenshots (if applicable) or Testing Completed

Verified on kernel 6.6.0 with both ftrace enabled and disabled scenarios. When ftrace is enabled fexit programs are used. When ftrace is disabled, the plugin uses kprobes/kretprobes.

image image

Additional Notes

Add any additional notes or context about the pull request here.


Please refer to the CONTRIBUTING.md file for more information on how to contribute to this project.

@SRodi SRodi self-assigned this Nov 4, 2025
@SRodi SRodi requested a review from a team as a code owner November 4, 2025 17:30
@SRodi SRodi requested review from jimassa and mainred November 4, 2025 17:30
Copy link
Contributor

@mereta mereta left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Copy link
Contributor

@alexcastilio alexcastilio left a comment

Choose a reason for hiding this comment

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

LGTM

@mereta mereta added this pull request to the merge queue Nov 5, 2025
Merged via the queue into microsoft:main with commit cbfce9b Nov 5, 2025
31 checks passed
@SRodi SRodi deleted the srodi/check-ftrace branch November 5, 2025 15:20
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.

6 participants