Skip to content
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

Make perf event buffer pageNum configurable instead of hard-coded #245

Closed
hengyoush opened this issue Jan 2, 2025 · 0 comments · Fixed by #247
Closed

Make perf event buffer pageNum configurable instead of hard-coded #245

hengyoush opened this issue Jan 2, 2025 · 0 comments · Fixed by #247
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@hengyoush
Copy link
Owner

hengyoush commented Jan 2, 2025

Currently, the third parameter passed to the following functions in agent.go is hard-coded (for example: 2048, 512, 4, 32):

  • PullSyscallDataEvents
  • PullSslDataEvents
  • PullConnDataEvents
  • PullKernEvents
err = bpf.PullSyscallDataEvents(ctx, pm.GetSyscallEventsChannels(), 2048, options.CustomSyscallEventHook)
err = bpf.PullSslDataEvents(ctx, pm.GetSslEventsChannels(), 512, options.CustomSslEventHook)
err = bpf.PullConnDataEvents(ctx, pm.GetConnEventsChannels(), 4, options.CustomConnEventHook)
err = bpf.PullKernEvents(ctx, pm.GetKernEventsChannels(), 32, options.CustomKernEventHook)

This parameter is used to control the size of the perf event buffer (pageNum).

Proposed Changes

  1. Add four configuration option (e.g., via command-line flags) to set pageNum for each event type.
  2. Replace the current hard-coded values in PullSyscallDataEvents, PullSslDataEvents, PullConnDataEvents, and PullKernEvents calls with a new configuration parameter.
  3. Provide sensible default values if no configuration is supplied(2048, 512, 4, 32).

Additional Context

Please add any suggestions or comments below. If you have an implementation idea, feel free to submit a pull request!

@hengyoush hengyoush added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jan 2, 2025
@hengyoush hengyoush changed the title Make perf event buffer pageNum configurable instead of hard-coded Make perf event buffer pageNum configurable instead of hard-coded Jan 2, 2025
Repository owner deleted a comment from dosubot bot Jan 3, 2025
Repository owner deleted a comment from dosubot bot Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant