xref: /minix3/minix/include/minix/btrace.h (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1 #ifndef _MINIX_BTRACE_H
2 #define _MINIX_BTRACE_H
3 
4 /* Control directives. */
5 enum {
6   BTCTL_START,
7   BTCTL_STOP
8 };
9 
10 /* Request codes. */
11 enum {
12   BTREQ_OPEN,
13   BTREQ_CLOSE,
14   BTREQ_READ,
15   BTREQ_WRITE,
16   BTREQ_GATHER,
17   BTREQ_SCATTER,
18   BTREQ_IOCTL
19 };
20 
21 /* Special result codes. */
22 #define BTRES_INPROGRESS	(-997)
23 
24 /* Block trace entry. */
25 typedef struct {
26   u32_t request;		/* request code; one of BTR_xxx */
27   u32_t size;			/* request size, ioctl request, or access */
28   u64_t position;		/* starting disk position */
29   u32_t flags;			/* transfer flags */
30   i32_t result;			/* request result; OK, bytes, or error */
31   u32_t start_time;		/* request service start time (us) */
32   u32_t finish_time;		/* request service completion time (us) */
33 } btrace_entry;			/* (32 bytes) */
34 
35 /* This is the number of btrace_entry structures copied out at once using the
36  * BIOCTRACEGET ioctl call.
37  */
38 #define BTBUF_SIZE	1024
39 
40 #endif /* _MINIX_BTRACE_H */
41