Skip to content

Commit 10e29fe

Browse files
committed
fix(config): add eventSocketPath in config.go
Change-Id: I9f59a5a6c51378ce4eb6553b2cd25625984791e3
1 parent af228e0 commit 10e29fe

2 files changed

Lines changed: 13 additions & 29 deletions

File tree

core/events/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ type Config struct {
3939
ExcludeContainers []string
4040
}
4141

42+
EventSocket struct {
43+
SocketPath string // unix socket receiving tool events; required, empty is an error
44+
}
45+
4246
Netdev struct {
4347
DeviceList []string
4448
}

core/events/dropwatch.go

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

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"
@@ -172,35 +173,14 @@ func (c *dropWatchTracing) ignore(data *types.DropWatchTracing) bool {
172173
}
173174
}
174175

175-
// stack:
176-
// 1. kfree_skb/ffffffff96d127b0
177-
// 2. kfree_skb/ffffffff96d127b0
178-
// 3. neigh_invalidate/ffffffff96d388b0
179-
// 4. neigh_timer_handler/ffffffff96d3a870
180-
// 5. ...
181-
// neigh_invalidate: ARP/neighbor table cleanup, filtered by config.
182-
if len(stack) >= 3 && strings.HasPrefix(stack[2], "neigh_invalidate/") {
183-
return true
184-
}
185-
186-
// stack:
187-
// 1. kfree_skb/ffffffff82283d10
188-
// 2. kfree_skb/ffffffff82283d10
189-
// 3. bnxt_tx_int/ffffffffc05c6f20
190-
// 4. __bnxt_poll_work_done/ffffffffc05c50c0
191-
// 5. ...
192-
//
193-
// stack:
194-
// 1. kfree_skb/ffffffffaba83d10
195-
// 2. kfree_skb/ffffffffaba83d10
196-
// 3. __bnxt_tx_int/ffffffffc045df90
197-
// 4. bnxt_tx_int/ffffffffc045e250
198-
// 5. ...
199-
// bnxt NIC TX completion path: driver frees skb normally, not a real drop.
200-
if len(stack) >= 3 &&
201-
(strings.HasPrefix(stack[2], "bnxt_tx_int/") ||
202-
strings.HasPrefix(stack[2], "__bnxt_tx_int/")) {
203-
return true
176+
// Operator-configured stack-frame noise rules (e.g. bnxt_tx_int,
177+
// neigh_invalidate). Patterns live in events.IssuesList; see
178+
// net_rx_latency.go for the same pattern. Match against data.Stack
179+
// (frames joined by '\n').
180+
if cfg != nil {
181+
if _, found := matcher.Classify(cfg.IssuesList, data.Stack); found {
182+
return true
183+
}
204184
}
205185

206186
return false

0 commit comments

Comments
 (0)