github.com/inspektor-gadget/inspektor-gadget@v0.28.1/pkg/gadgets/top/block-io/tracer/bpf/biotop.h (about)

     1  /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
     2  #ifndef __BIOTOP_H
     3  #define __BIOTOP_H
     4  
     5  #define REQ_OP_BITS 8
     6  #define REQ_OP_MASK ((1 << REQ_OP_BITS) - 1)
     7  
     8  #define TASK_COMM_LEN 16
     9  
    10  // for saving the timestamp and __data_len of each request
    11  struct start_req_t {
    12  	__u64 ts;
    13  	__u64 data_len;
    14  };
    15  
    16  // for saving process info by request
    17  struct who_t {
    18  	__u64 mntnsid;
    19  	__u32 pid;
    20  	char name[TASK_COMM_LEN];
    21  };
    22  
    23  // the key for the output summary
    24  struct info_t {
    25  	__u64 mntnsid;
    26  	__u32 pid;
    27  	int rwflag;
    28  	int major;
    29  	int minor;
    30  	__u8 name[TASK_COMM_LEN];
    31  };
    32  
    33  // the value of the output summary
    34  struct val_t {
    35  	__u64 bytes;
    36  	__u64 us;
    37  	__u32 io;
    38  };
    39  
    40  #endif /* __BIOTOP_H */