github.com/inspektor-gadget/inspektor-gadget@v0.28.1/pkg/gadgets/trace/mount/tracer/bpf/mountsnoop.h (about)

     1  /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
     2  #ifndef __MOUNTSNOOP_H
     3  #define __MOUNTSNOOP_H
     4  
     5  #define TASK_COMM_LEN 16
     6  #define FS_NAME_LEN 8
     7  #define DATA_LEN 512
     8  #define PATH_MAX 4096
     9  
    10  enum op {
    11  	MOUNT,
    12  	UMOUNT,
    13  };
    14  
    15  struct arg {
    16  	__u64 ts;
    17  	__u64 flags;
    18  	const char *src;
    19  	const char *dest;
    20  	const char *fs;
    21  	const char *data;
    22  	enum op op;
    23  };
    24  
    25  struct event {
    26  	__u64 delta;
    27  	__u64 flags;
    28  	__u32 pid;
    29  	__u32 tid;
    30  	__u64 mount_ns_id;
    31  	__u64 timestamp;
    32  	int ret;
    33  	__u8 comm[TASK_COMM_LEN];
    34  	__u8 fs[FS_NAME_LEN];
    35  	__u8 src[PATH_MAX];
    36  	__u8 dest[PATH_MAX];
    37  	__u8 data[DATA_LEN];
    38  	enum op op;
    39  };
    40  
    41  #endif /* __MOUNTSNOOP_H */