Skip to content

fix: remove duration arg from 22 event-based BCC tools (fixes #19)#20

Merged
dmitriimaksimovdevelop merged 1 commit into
masterfrom
fix/issue-19-bcc-tool-args
Apr 6, 2026
Merged

fix: remove duration arg from 22 event-based BCC tools (fixes #19)#20
dmitriimaksimovdevelop merged 1 commit into
masterfrom
fix/issue-19-bcc-tool-args

Conversation

@dmitriimaksimovdevelop
Copy link
Copy Markdown
Owner

Fixes #19

Problem

Event-based BCC tracers don't accept a duration positional argument. melisai was passing formatDuration(d) (e.g., 10) to all tools, causing:

tcpretrans-bpfcc: error: unrecognized arguments: 10

Root Cause

The registry assumed all BCC tools accept <seconds> as positional arg. In reality, BCC tools split into two categories:

  • Duration-based (histograms/sampling): runqlat 10 1, biolatency -D 10 1 — accept seconds
  • Event-based (tracers): tcpretrans, killsnoop, oomkill — run until killed, no duration arg

Fix

22 event-based tools now return nil args (rely on context timeout to kill):

Category Tools
Network tcpretrans, tcpdrop, tcpstates, tcpconnect, tcpaccept, tcplife, udpconnect, sofdsnoop, skbdrop
Process killsnoop, threadsnoop, syncsnoop, exitsnoop, capable
Disk filelife, mountsnoop, mdflush
Memory oomkill, shmsnoop, drsnoop, numamove
CPU cpufreq
Filter-based tcpconnlat (arg is min_ms filter, not duration), gethostlatency

Note on biolatency

The biolatency failure in #19 is a BCC/kernel compatibility issueblk_account_io_done kprobe was removed in kernel 6.x. This requires an updated bcc-tools package and is not fixable in melisai.

Tests

  • TestEventBasedToolsNoArgs: verifies all 22 event tools pass no args
  • TestDurationToolsHaveArgs: guards that histogram/sampling tools still pass duration

🤖 Generated with Claude Code

Event-based BCC tracers (tcpretrans, tcpdrop, killsnoop, etc.) run
until killed — they don't accept a duration positional argument.
Passing formatDuration(d) caused "unrecognized arguments: 10" errors.

Fixed tools (22 total):
- Network: tcpretrans, tcpdrop, tcpstates, tcpconnect, tcpaccept,
  tcplife, udpconnect, sofdsnoop, skbdrop
- Process: killsnoop, threadsnoop, syncsnoop, exitsnoop, capable
- Disk: filelife, mountsnoop, mdflush
- Memory: oomkill, shmsnoop, drsnoop, numamove
- CPU: cpufreq
- Filter-based (positional arg is threshold, not duration):
  tcpconnlat (min_ms), gethostlatency (no positional args)

Note: biolatency failure in #19 is a BCC/kernel compat issue
(blk_account_io_done kprobe removed in kernel 6.x). Requires
updated bcc-tools package, not fixable in melisai.

Tests:
- TestEventBasedToolsNoArgs: verifies all 22 event tools pass no args
- TestDurationToolsHaveArgs: guards that histogram/sampling tools
  still pass duration correctly

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dmitriimaksimovdevelop dmitriimaksimovdevelop merged commit de4d261 into master Apr 6, 2026
1 check passed
@dmitriimaksimovdevelop dmitriimaksimovdevelop deleted the fix/issue-19-bcc-tool-args branch April 7, 2026 07:59
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.

biolatency and tcpretrans BCC tools fail during melisai collect

1 participant