File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,22 @@ func main() {
3939 }
4040 defer kp .Close ()
4141
42+ monitoredInodeMap := coll .Maps ["monitored_inodes" ]
43+ if monitoredInodeMap == nil {
44+ log .Printf ("Map 'monitored_inode' not found in collection. Skipping pinning." )
45+ } else {
46+ pinPath := "/sys/fs/bpf/monitored_inode"
47+ if err := os .Remove (pinPath ); err != nil && ! os .IsNotExist (err ) {
48+ log .Printf ("Warning: failed to remove existing pin at %s: %v" , pinPath , err )
49+ }
50+
51+ if err := monitoredInodeMap .Pin (pinPath ); err != nil {
52+ log .Fatalf ("Failed to pin map 'monitored_inode' to %s: %v" , pinPath , err )
53+ }
54+ log .Printf ("Map 'monitored_inode' pinned to %s" , pinPath )
55+ }
56+
57+
4258 events := coll .Maps ["events" ]
4359 if events == nil {
4460 log .Fatalf ("Map 'events' not found" )
You can’t perform that action at this time.
0 commit comments