Skip to content

Commit 9f23d3e

Browse files
committed
dropwatch: drive noise filtering from events.IssuesList
Replace the hard-coded neigh_invalidate / bnxt_tx_int branches with a single matcher.Classify call against cfg.IssuesList, mirroring core/events/net_rx_latency.go. The two default rules now ship as TOML data in huatuo-bamai.conf; operators add, remove, or override entries without touching code. The CLOSE_WAIT + skb_rbtree_purge branch reads sk_state and stays in code.
1 parent 55cee5b commit 9f23d3e

1 file changed

Lines changed: 9 additions & 29 deletions

File tree

core/events/dropwatch.go

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424

2525
internalconfig "huatuo-bamai/internal/config"
2626
"huatuo-bamai/internal/log"
27+
"huatuo-bamai/internal/matcher"
2728
"huatuo-bamai/internal/packet"
2829
"huatuo-bamai/internal/pod"
2930
"huatuo-bamai/internal/toolstream"
@@ -156,35 +157,14 @@ func ignoreDropwatch(data *types.DropWatchTracing) bool {
156157
}
157158
}
158159

159-
// stack:
160-
// 1. kfree_skb/ffffffff96d127b0
161-
// 2. kfree_skb/ffffffff96d127b0
162-
// 3. neigh_invalidate/ffffffff96d388b0
163-
// 4. neigh_timer_handler/ffffffff96d3a870
164-
// 5. ...
165-
// neigh_invalidate: ARP/neighbor table cleanup, filtered by config.
166-
if len(stack) >= 3 && strings.HasPrefix(stack[2], "neigh_invalidate/") {
167-
return true
168-
}
169-
170-
// stack:
171-
// 1. kfree_skb/ffffffff82283d10
172-
// 2. kfree_skb/ffffffff82283d10
173-
// 3. bnxt_tx_int/ffffffffc05c6f20
174-
// 4. __bnxt_poll_work_done/ffffffffc05c50c0
175-
// 5. ...
176-
//
177-
// stack:
178-
// 1. kfree_skb/ffffffffaba83d10
179-
// 2. kfree_skb/ffffffffaba83d10
180-
// 3. __bnxt_tx_int/ffffffffc045df90
181-
// 4. bnxt_tx_int/ffffffffc045e250
182-
// 5. ...
183-
// bnxt NIC TX completion path: driver frees skb normally, not a real drop.
184-
if len(stack) >= 3 &&
185-
(strings.HasPrefix(stack[2], "bnxt_tx_int/") ||
186-
strings.HasPrefix(stack[2], "__bnxt_tx_int/")) {
187-
return true
160+
// Operator-configured stack-frame noise rules (e.g. bnxt_tx_int,
161+
// neigh_invalidate). Patterns live in events.IssuesList; see
162+
// net_rx_latency.go for the same pattern. Match against data.Stack
163+
// (frames joined by '\n').
164+
if cfg != nil {
165+
if _, found := matcher.Classify(cfg.IssuesList, data.Stack); found {
166+
return true
167+
}
188168
}
189169

190170
return false

0 commit comments

Comments
 (0)