github.com/inspektor-gadget/inspektor-gadget@v0.28.1/pkg/gadgets/top/file/tracer/bpf/filetop.h (about)

     1  /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
     2  #ifndef __FILETOP_H
     3  #define __FILETOP_H
     4  
     5  #define PATH_MAX 4096
     6  #define TASK_COMM_LEN 16
     7  
     8  enum op {
     9  	READ,
    10  	WRITE,
    11  };
    12  
    13  struct file_id {
    14  	__u64 inode;
    15  	__u32 dev;
    16  	__u32 pid;
    17  	__u32 tid;
    18  };
    19  
    20  struct file_stat {
    21  	__u64 reads;
    22  	__u64 read_bytes;
    23  	__u64 writes;
    24  	__u64 write_bytes;
    25  	__u32 pid;
    26  	__u32 tid;
    27  	__u64 mntns_id;
    28  	__u8 filename[PATH_MAX];
    29  	__u8 comm[TASK_COMM_LEN];
    30  	char type_;
    31  };
    32  
    33  #endif /* __FILETOP_H */