Home | History | Annotate | Download | only in linux
      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 KCT_H_
     20 #define KCT_H_
     21 #include <linux/netlink.h>
     22 #define EV_FLAGS_PRIORITY_LOW (1<<0)
     23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     24 #ifndef MAX_SB_N
     25 #define MAX_SB_N 32
     26 #endif
     27 #ifndef MAX_EV_N
     28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     29 #define MAX_EV_N 32
     30 #endif
     31 #define NETLINK_CRASHTOOL 27
     32 #define ATTCHMT_ALIGN 4U
     33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     34 enum ct_ev_type {
     35  CT_EV_STAT,
     36  CT_EV_INFO,
     37  CT_EV_ERROR,
     38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     39  CT_EV_CRASH,
     40  CT_EV_LAST
     41 };
     42 enum ct_attchmt_type {
     43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     44  CT_ATTCHMT_DATA0,
     45  CT_ATTCHMT_DATA1,
     46  CT_ATTCHMT_DATA2,
     47  CT_ATTCHMT_DATA3,
     48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     49  CT_ATTCHMT_DATA4,
     50  CT_ATTCHMT_DATA5,
     51  CT_ATTCHMT_BINARY,
     52  CT_ATTCHMT_FILELIST
     53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     54 };
     55 struct ct_attchmt {
     56  __u32 size;
     57  enum ct_attchmt_type type;
     58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     59  char data[];
     60 } __aligned(4);
     61 struct ct_event {
     62  __u64 timestamp;
     63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     64  char submitter_name[MAX_SB_N];
     65  char ev_name[MAX_EV_N];
     66  enum ct_ev_type type;
     67  __u32 attchmt_size;
     68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     69  __u32 flags;
     70  struct ct_attchmt attachments[];
     71 } __aligned(4);
     72 enum kct_nlmsg_type {
     73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     74  KCT_EVENT,
     75  KCT_SET_PID = 4200,
     76 };
     77 struct kct_packet {
     78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     79  struct nlmsghdr nlh;
     80  struct ct_event event;
     81 };
     82 #define ATTCHMT_ALIGNMENT 4
     83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     84 #ifndef KCT_ALIGN
     85 #define __KCT_ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask))
     86 #define __KCT_ALIGN(x, a) __KCT_ALIGN_MASK(x, (typeof(x))(a) - 1)
     87 #define KCT_ALIGN(x, a) __KCT_ALIGN((x), (a))
     88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     89 #endif
     90 #define foreach_attchmt(Event, Attchmt)   if ((Event)->attchmt_size)   for ((Attchmt) = (Event)->attachments;   (Attchmt) < (typeof(Attchmt))(((char *)   (Event)->attachments) +   (Event)->attchmt_size);   (Attchmt) = (typeof(Attchmt))KCT_ALIGN(((size_t)(Attchmt))   + sizeof(*(Attchmt)) +   (Attchmt)->size, ATTCHMT_ALIGNMENT))
     91 #define MKFN(fn, ...) MKFN_N(fn, ##__VA_ARGS__, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)(__VA_ARGS__)
     92 #define MKFN_N(fn, n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n, ...) fn##n
     93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     94 #define kct_log(...) MKFN(__kct_log_, ##__VA_ARGS__)
     95 #define __kct_log_4(Type, Submitter_name, Ev_name, flags)   do { if (kct_alloc_event) {   struct ct_event *__ev =   kct_alloc_event(Submitter_name, Ev_name, Type,   GFP_ATOMIC, flags);   if (__ev) {   kct_log_event(__ev, GFP_ATOMIC);   }   } } while (0)
     96 #define __kct_log_5(Type, Submitter_name, Ev_name, flags, Data0)   do { if (kct_alloc_event) {   struct ct_event *__ev =   kct_alloc_event(Submitter_name, Ev_name, Type,   GFP_ATOMIC, flags);   if (__ev) {   if (Data0)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA0,   strlen(Data0) + 1, Data0, GFP_ATOMIC);   kct_log_event(__ev, GFP_ATOMIC);   }   } } while (0)
     97 #define __kct_log_6(Type, Submitter_name, Ev_name, flags, Data0, Data1)   do { if (kct_alloc_event) {   struct ct_event *__ev =   kct_alloc_event(Submitter_name, Ev_name, Type,   GFP_ATOMIC, flags);   if (__ev) {   if (Data0)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA0,   strlen(Data0) + 1, Data0, GFP_ATOMIC);   if (Data1)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA1,   strlen(Data1) + 1, Data1, GFP_ATOMIC);   kct_log_event(__ev, GFP_ATOMIC);   }   } } while (0)
     98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     99 #define __kct_log_7(Type, Submitter_name, Ev_name, flags, Data0, Data1, Data2)   do { if (kct_alloc_event) {   struct ct_event *__ev =   kct_alloc_event(Submitter_name, Ev_name, Type,   GFP_ATOMIC, flags);   if (__ev) {   if (Data0)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA0,   strlen(Data0) + 1, Data0, GFP_ATOMIC);   if (Data1)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA1,   strlen(Data1) + 1, Data1, GFP_ATOMIC);   if (Data2)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA2,   strlen(Data2) + 1, Data2, GFP_ATOMIC);   kct_log_event(__ev, GFP_ATOMIC);   }   } } while (0)
    100 #define __kct_log_8(Type, Submitter_name, Ev_name, flags, Data0, Data1, Data2,   Data3)   do { if (kct_alloc_event) {   struct ct_event *__ev =   kct_alloc_event(Submitter_name, Ev_name, Type,   GFP_ATOMIC, flags);   if (__ev) {   if (Data0)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA0,   strlen(Data0) + 1, Data0, GFP_ATOMIC);   if (Data1)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA1,   strlen(Data1) + 1, Data1, GFP_ATOMIC);   if (Data2)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA2,   strlen(Data2) + 1, Data2, GFP_ATOMIC);   if (Data3)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA3,   strlen(Data3) + 1, Data3, GFP_ATOMIC);   kct_log_event(__ev, GFP_ATOMIC);   }   } } while (0)
    101 #define __kct_log_9(Type, Submitter_name, Ev_name, flags, Data0, Data1, Data2,   Data3, Data4)   do { if (kct_alloc_event) {   struct ct_event *__ev =   kct_alloc_event(Submitter_name, Ev_name, Type,   GFP_ATOMIC, flags);   if (__ev) {   if (Data0)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA0,   strlen(Data0) + 1, Data0, GFP_ATOMIC);   if (Data1)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA1,   strlen(Data1) + 1, Data1, GFP_ATOMIC);   if (Data2)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA2,   strlen(Data2) + 1, Data2, GFP_ATOMIC);   if (Data3)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA3,   strlen(Data3) + 1, Data3, GFP_ATOMIC);   if (Data4)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA4,   strlen(Data4) + 1, Data4, GFP_ATOMIC);   kct_log_event(__ev, GFP_ATOMIC);   }   } } while (0)
    102 #define __kct_log_10(Type, Submitter_name, Ev_name, flags, Data0, Data1, Data2,   Data3, Data4, Data5)   do { if (kct_alloc_event) {   struct ct_event *__ev =   kct_alloc_event(Submitter_name, Ev_name, Type,   GFP_ATOMIC, flags);   if (__ev) {   if (Data0)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA0,   strlen(Data0) + 1, Data0, GFP_ATOMIC);   if (Data1)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA1,   strlen(Data1) + 1, Data1, GFP_ATOMIC);   if (Data2)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA2,   strlen(Data2) + 1, Data2, GFP_ATOMIC);   if (Data3)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA3,   strlen(Data3) + 1, Data3, GFP_ATOMIC);   if (Data4)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA4,   strlen(Data4) + 1, Data4, GFP_ATOMIC);   if (Data5)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA5,   strlen(Data5) + 1, Data5, GFP_ATOMIC);   kct_log_event(__ev, GFP_ATOMIC);   }   } } while (0)
    103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    104 #define __kct_log_11(Type, Submitter_name, Ev_name, flags, Data0, Data1, Data2,   Data3, Data4, Data5, filelist)   do { if (kct_alloc_event) {   struct ct_event *__ev =   kct_alloc_event(Submitter_name, Ev_name, Type,   GFP_ATOMIC, flags);   if (__ev) {   if (Data0)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA0,   strlen(Data0) + 1, Data0, GFP_ATOMIC);   if (Data1)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA1,   strlen(Data1) + 1, Data1, GFP_ATOMIC);   if (Data2)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA2,   strlen(Data2) + 1, Data2, GFP_ATOMIC);   if (Data3)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA3,   strlen(Data3) + 1, Data3, GFP_ATOMIC);   if (Data4)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA4,   strlen(Data4) + 1, Data4, GFP_ATOMIC);   if (Data5)   kct_add_attchmt(&__ev, CT_ATTCHMT_DATA5,   strlen(Data5) + 1, Data5, GFP_ATOMIC);   if (filelist)   kct_add_attchmt(&__ev, CT_ATTCHMT_FILELIST,   strlen(filelist) + 1, filelist, GFP_ATOMIC);   kct_log_event(__ev, GFP_ATOMIC);   }   } } while (0)
    105 #endif
    106 
    107