1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _UAPIBLKTRACE_H
20 #define _UAPIBLKTRACE_H
21 #include <linux/types.h>
22 enum blktrace_cat {
23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24   BLK_TC_READ = 1 << 0,
25   BLK_TC_WRITE = 1 << 1,
26   BLK_TC_FLUSH = 1 << 2,
27   BLK_TC_SYNC = 1 << 3,
28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29   BLK_TC_SYNCIO = BLK_TC_SYNC,
30   BLK_TC_QUEUE = 1 << 4,
31   BLK_TC_REQUEUE = 1 << 5,
32   BLK_TC_ISSUE = 1 << 6,
33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34   BLK_TC_COMPLETE = 1 << 7,
35   BLK_TC_FS = 1 << 8,
36   BLK_TC_PC = 1 << 9,
37   BLK_TC_NOTIFY = 1 << 10,
38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39   BLK_TC_AHEAD = 1 << 11,
40   BLK_TC_META = 1 << 12,
41   BLK_TC_DISCARD = 1 << 13,
42   BLK_TC_DRV_DATA = 1 << 14,
43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44   BLK_TC_FUA = 1 << 15,
45   BLK_TC_END = 1 << 15,
46 };
47 #define BLK_TC_SHIFT (16)
48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49 #define BLK_TC_ACT(act) ((act) << BLK_TC_SHIFT)
50 enum blktrace_act {
51   __BLK_TA_QUEUE = 1,
52   __BLK_TA_BACKMERGE,
53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54   __BLK_TA_FRONTMERGE,
55   __BLK_TA_GETRQ,
56   __BLK_TA_SLEEPRQ,
57   __BLK_TA_REQUEUE,
58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59   __BLK_TA_ISSUE,
60   __BLK_TA_COMPLETE,
61   __BLK_TA_PLUG,
62   __BLK_TA_UNPLUG_IO,
63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64   __BLK_TA_UNPLUG_TIMER,
65   __BLK_TA_INSERT,
66   __BLK_TA_SPLIT,
67   __BLK_TA_BOUNCE,
68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69   __BLK_TA_REMAP,
70   __BLK_TA_ABORT,
71   __BLK_TA_DRV_DATA,
72 };
73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74 enum blktrace_notify {
75   __BLK_TN_PROCESS = 0,
76   __BLK_TN_TIMESTAMP,
77   __BLK_TN_MESSAGE,
78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79 };
80 #define BLK_TA_QUEUE (__BLK_TA_QUEUE | BLK_TC_ACT(BLK_TC_QUEUE))
81 #define BLK_TA_BACKMERGE (__BLK_TA_BACKMERGE | BLK_TC_ACT(BLK_TC_QUEUE))
82 #define BLK_TA_FRONTMERGE (__BLK_TA_FRONTMERGE | BLK_TC_ACT(BLK_TC_QUEUE))
83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84 #define BLK_TA_GETRQ (__BLK_TA_GETRQ | BLK_TC_ACT(BLK_TC_QUEUE))
85 #define BLK_TA_SLEEPRQ (__BLK_TA_SLEEPRQ | BLK_TC_ACT(BLK_TC_QUEUE))
86 #define BLK_TA_REQUEUE (__BLK_TA_REQUEUE | BLK_TC_ACT(BLK_TC_REQUEUE))
87 #define BLK_TA_ISSUE (__BLK_TA_ISSUE | BLK_TC_ACT(BLK_TC_ISSUE))
88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89 #define BLK_TA_COMPLETE (__BLK_TA_COMPLETE | BLK_TC_ACT(BLK_TC_COMPLETE))
90 #define BLK_TA_PLUG (__BLK_TA_PLUG | BLK_TC_ACT(BLK_TC_QUEUE))
91 #define BLK_TA_UNPLUG_IO (__BLK_TA_UNPLUG_IO | BLK_TC_ACT(BLK_TC_QUEUE))
92 #define BLK_TA_UNPLUG_TIMER (__BLK_TA_UNPLUG_TIMER | BLK_TC_ACT(BLK_TC_QUEUE))
93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94 #define BLK_TA_INSERT (__BLK_TA_INSERT | BLK_TC_ACT(BLK_TC_QUEUE))
95 #define BLK_TA_SPLIT (__BLK_TA_SPLIT)
96 #define BLK_TA_BOUNCE (__BLK_TA_BOUNCE)
97 #define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE))
98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99 #define BLK_TA_ABORT (__BLK_TA_ABORT | BLK_TC_ACT(BLK_TC_QUEUE))
100 #define BLK_TA_DRV_DATA (__BLK_TA_DRV_DATA | BLK_TC_ACT(BLK_TC_DRV_DATA))
101 #define BLK_TN_PROCESS (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY))
102 #define BLK_TN_TIMESTAMP (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY))
103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104 #define BLK_TN_MESSAGE (__BLK_TN_MESSAGE | BLK_TC_ACT(BLK_TC_NOTIFY))
105 #define BLK_IO_TRACE_MAGIC 0x65617400
106 #define BLK_IO_TRACE_VERSION 0x07
107 struct blk_io_trace {
108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109   __u32 magic;
110   __u32 sequence;
111   __u64 time;
112   __u64 sector;
113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114   __u32 bytes;
115   __u32 action;
116   __u32 pid;
117   __u32 device;
118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119   __u32 cpu;
120   __u16 error;
121   __u16 pdu_len;
122 };
123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124 struct blk_io_trace_remap {
125   __be32 device_from;
126   __be32 device_to;
127   __be64 sector_from;
128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129 };
130 enum {
131   Blktrace_setup = 1,
132   Blktrace_running,
133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134   Blktrace_stopped,
135 };
136 #define BLKTRACE_BDEV_SIZE 32
137 struct blk_user_trace_setup {
138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139   char name[BLKTRACE_BDEV_SIZE];
140   __u16 act_mask;
141   __u32 buf_size;
142   __u32 buf_nr;
143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144   __u64 start_lba;
145   __u64 end_lba;
146   __u32 pid;
147 };
148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149 #endif
150