~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/include/linux/btf_ids.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /tools/include/linux/btf_ids.h (Version linux-6.12-rc7) and /tools/include/linux/btf_ids.h (Version linux-5.13.19)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 /* SPDX-License-Identifier: GPL-2.0 */
  2                                                     2 
  3 #ifndef _LINUX_BTF_IDS_H                            3 #ifndef _LINUX_BTF_IDS_H
  4 #define _LINUX_BTF_IDS_H                            4 #define _LINUX_BTF_IDS_H
  5                                                     5 
  6 #include <linux/types.h> /* for u32 */         << 
  7                                                << 
  8 struct btf_id_set {                                 6 struct btf_id_set {
  9         u32 cnt;                                    7         u32 cnt;
 10         u32 ids[];                                  8         u32 ids[];
 11 };                                                  9 };
 12                                                    10 
 13 struct btf_id_set8 {                           << 
 14         u32 cnt;                               << 
 15         u32 flags;                             << 
 16         struct {                               << 
 17                 u32 id;                        << 
 18                 u32 flags;                     << 
 19         } pairs[];                             << 
 20 };                                             << 
 21                                                << 
 22 #ifdef CONFIG_DEBUG_INFO_BTF                       11 #ifdef CONFIG_DEBUG_INFO_BTF
 23                                                    12 
 24 #include <linux/compiler.h> /* for __PASTE */      13 #include <linux/compiler.h> /* for __PASTE */
 25                                                    14 
 26 /*                                                 15 /*
 27  * Following macros help to define lists of BT     16  * Following macros help to define lists of BTF IDs placed
 28  * in .BTF_ids section. They are initially fil     17  * in .BTF_ids section. They are initially filled with zeros
 29  * (during compilation) and resolved later dur     18  * (during compilation) and resolved later during the
 30  * linking phase by resolve_btfids tool.           19  * linking phase by resolve_btfids tool.
 31  *                                                 20  *
 32  * Any change in list layout must be reflected     21  * Any change in list layout must be reflected in resolve_btfids
 33  * tool logic.                                     22  * tool logic.
 34  */                                                23  */
 35                                                    24 
 36 #define BTF_IDS_SECTION ".BTF_ids"                 25 #define BTF_IDS_SECTION ".BTF_ids"
 37                                                    26 
 38 #define ____BTF_ID(symbol)                         27 #define ____BTF_ID(symbol)                              \
 39 asm(                                               28 asm(                                                    \
 40 ".pushsection " BTF_IDS_SECTION ",\"a\";           29 ".pushsection " BTF_IDS_SECTION ",\"a\";       \n"      \
 41 ".local " #symbol " ;                              30 ".local " #symbol " ;                          \n"      \
 42 ".type  " #symbol ", STT_OBJECT;                   31 ".type  " #symbol ", STT_OBJECT;               \n"      \
 43 ".size  " #symbol ", 4;                            32 ".size  " #symbol ", 4;                        \n"      \
 44 #symbol ":                                         33 #symbol ":                                     \n"      \
 45 ".zero 4                                           34 ".zero 4                                       \n"      \
 46 ".popsection;                                      35 ".popsection;                                  \n");
 47                                                    36 
 48 #define __BTF_ID(symbol) \                         37 #define __BTF_ID(symbol) \
 49         ____BTF_ID(symbol)                         38         ____BTF_ID(symbol)
 50                                                    39 
 51 #define __ID(prefix) \                             40 #define __ID(prefix) \
 52         __PASTE(__PASTE(prefix, __COUNTER__),  !!  41         __PASTE(prefix, __COUNTER__)
 53                                                    42 
 54 /*                                                 43 /*
 55  * The BTF_ID defines unique symbol for each I     44  * The BTF_ID defines unique symbol for each ID pointing
 56  * to 4 zero bytes.                                45  * to 4 zero bytes.
 57  */                                                46  */
 58 #define BTF_ID(prefix, name) \                     47 #define BTF_ID(prefix, name) \
 59         __BTF_ID(__ID(__BTF_ID__##prefix##__##     48         __BTF_ID(__ID(__BTF_ID__##prefix##__##name##__))
 60                                                    49 
 61 /*                                                 50 /*
 62  * The BTF_ID_LIST macro defines pure (unsorte     51  * The BTF_ID_LIST macro defines pure (unsorted) list
 63  * of BTF IDs, with following layout:              52  * of BTF IDs, with following layout:
 64  *                                                 53  *
 65  * BTF_ID_LIST(list1)                              54  * BTF_ID_LIST(list1)
 66  * BTF_ID(type1, name1)                            55  * BTF_ID(type1, name1)
 67  * BTF_ID(type2, name2)                            56  * BTF_ID(type2, name2)
 68  *                                                 57  *
 69  * list1:                                          58  * list1:
 70  * __BTF_ID__type1__name1__1:                      59  * __BTF_ID__type1__name1__1:
 71  * .zero 4                                         60  * .zero 4
 72  * __BTF_ID__type2__name2__2:                      61  * __BTF_ID__type2__name2__2:
 73  * .zero 4                                         62  * .zero 4
 74  *                                                 63  *
 75  */                                                64  */
 76 #define __BTF_ID_LIST(name, scope)                 65 #define __BTF_ID_LIST(name, scope)                      \
 77 asm(                                               66 asm(                                                    \
 78 ".pushsection " BTF_IDS_SECTION ",\"a\";           67 ".pushsection " BTF_IDS_SECTION ",\"a\";       \n"      \
 79 "." #scope " " #name ";                            68 "." #scope " " #name ";                        \n"      \
 80 #name ":;                                          69 #name ":;                                      \n"      \
 81 ".popsection;                                      70 ".popsection;                                  \n");
 82                                                    71 
 83 #define BTF_ID_LIST(name)                          72 #define BTF_ID_LIST(name)                               \
 84 __BTF_ID_LIST(name, local)                         73 __BTF_ID_LIST(name, local)                              \
 85 extern u32 name[];                                 74 extern u32 name[];
 86                                                    75 
 87 #define BTF_ID_LIST_GLOBAL(name, n)            !!  76 #define BTF_ID_LIST_GLOBAL(name)                        \
 88 __BTF_ID_LIST(name, globl)                         77 __BTF_ID_LIST(name, globl)
 89                                                    78 
 90 /* The BTF_ID_LIST_SINGLE macro defines a BTF_     79 /* The BTF_ID_LIST_SINGLE macro defines a BTF_ID_LIST with
 91  * a single entry.                                 80  * a single entry.
 92  */                                                81  */
 93 #define BTF_ID_LIST_SINGLE(name, prefix, typen     82 #define BTF_ID_LIST_SINGLE(name, prefix, typename)      \
 94         BTF_ID_LIST(name) \                        83         BTF_ID_LIST(name) \
 95         BTF_ID(prefix, typename)                   84         BTF_ID(prefix, typename)
 96 #define BTF_ID_LIST_GLOBAL_SINGLE(name, prefix << 
 97         BTF_ID_LIST_GLOBAL(name, 1)            << 
 98         BTF_ID(prefix, typename)               << 
 99                                                    85 
100 /*                                                 86 /*
101  * The BTF_ID_UNUSED macro defines 4 zero byte     87  * The BTF_ID_UNUSED macro defines 4 zero bytes.
102  * It's used when we want to define 'unused' e     88  * It's used when we want to define 'unused' entry
103  * in BTF_ID_LIST, like:                           89  * in BTF_ID_LIST, like:
104  *                                                 90  *
105  *   BTF_ID_LIST(bpf_skb_output_btf_ids)           91  *   BTF_ID_LIST(bpf_skb_output_btf_ids)
106  *   BTF_ID(struct, sk_buff)                       92  *   BTF_ID(struct, sk_buff)
107  *   BTF_ID_UNUSED                                 93  *   BTF_ID_UNUSED
108  *   BTF_ID(struct, task_struct)                   94  *   BTF_ID(struct, task_struct)
109  */                                                95  */
110                                                    96 
111 #define BTF_ID_UNUSED                              97 #define BTF_ID_UNUSED                                   \
112 asm(                                               98 asm(                                                    \
113 ".pushsection " BTF_IDS_SECTION ",\"a\";           99 ".pushsection " BTF_IDS_SECTION ",\"a\";       \n"      \
114 ".zero 4                                          100 ".zero 4                                       \n"      \
115 ".popsection;                                     101 ".popsection;                                  \n");
116                                                   102 
117 /*                                                103 /*
118  * The BTF_SET_START/END macros pair defines s    104  * The BTF_SET_START/END macros pair defines sorted list of
119  * BTF IDs plus its members count, with follow    105  * BTF IDs plus its members count, with following layout:
120  *                                                106  *
121  * BTF_SET_START(list)                            107  * BTF_SET_START(list)
122  * BTF_ID(type1, name1)                           108  * BTF_ID(type1, name1)
123  * BTF_ID(type2, name2)                           109  * BTF_ID(type2, name2)
124  * BTF_SET_END(list)                              110  * BTF_SET_END(list)
125  *                                                111  *
126  * __BTF_ID__set__list:                           112  * __BTF_ID__set__list:
127  * .zero 4                                        113  * .zero 4
128  * list:                                          114  * list:
129  * __BTF_ID__type1__name1__3:                     115  * __BTF_ID__type1__name1__3:
130  * .zero 4                                        116  * .zero 4
131  * __BTF_ID__type2__name2__4:                     117  * __BTF_ID__type2__name2__4:
132  * .zero 4                                        118  * .zero 4
133  *                                                119  *
134  */                                               120  */
135 #define __BTF_SET_START(name, scope)              121 #define __BTF_SET_START(name, scope)                    \
136 asm(                                              122 asm(                                                    \
137 ".pushsection " BTF_IDS_SECTION ",\"a\";          123 ".pushsection " BTF_IDS_SECTION ",\"a\";       \n"      \
138 "." #scope " __BTF_ID__set__" #name ";            124 "." #scope " __BTF_ID__set__" #name ";         \n"      \
139 "__BTF_ID__set__" #name ":;                       125 "__BTF_ID__set__" #name ":;                    \n"      \
140 ".zero 4                                          126 ".zero 4                                       \n"      \
141 ".popsection;                                     127 ".popsection;                                  \n");
142                                                   128 
143 #define BTF_SET_START(name)                       129 #define BTF_SET_START(name)                             \
144 __BTF_ID_LIST(name, local)                        130 __BTF_ID_LIST(name, local)                              \
145 __BTF_SET_START(name, local)                      131 __BTF_SET_START(name, local)
146                                                   132 
147 #define BTF_SET_START_GLOBAL(name)                133 #define BTF_SET_START_GLOBAL(name)                      \
148 __BTF_ID_LIST(name, globl)                        134 __BTF_ID_LIST(name, globl)                              \
149 __BTF_SET_START(name, globl)                      135 __BTF_SET_START(name, globl)
150                                                   136 
151 #define BTF_SET_END(name)                         137 #define BTF_SET_END(name)                               \
152 asm(                                              138 asm(                                                    \
153 ".pushsection " BTF_IDS_SECTION ",\"a\";          139 ".pushsection " BTF_IDS_SECTION ",\"a\";      \n"       \
154 ".size __BTF_ID__set__" #name ", .-" #name "      140 ".size __BTF_ID__set__" #name ", .-" #name "  \n"       \
155 ".popsection;                                     141 ".popsection;                                 \n");     \
156 extern struct btf_id_set name;                    142 extern struct btf_id_set name;
157                                                   143 
158 #else                                             144 #else
159                                                   145 
160 #define BTF_ID_LIST(name) static u32 __maybe_u !! 146 #define BTF_ID_LIST(name) static u32 name[5];
161 #define BTF_ID(prefix, name)                      147 #define BTF_ID(prefix, name)
162 #define BTF_ID_UNUSED                             148 #define BTF_ID_UNUSED
163 #define BTF_ID_LIST_GLOBAL(name, n) u32 __mayb !! 149 #define BTF_ID_LIST_GLOBAL(name) u32 name[1];
164 #define BTF_ID_LIST_SINGLE(name, prefix, typen !! 150 #define BTF_ID_LIST_SINGLE(name, prefix, typename) static u32 name[1];
165 #define BTF_ID_LIST_GLOBAL_SINGLE(name, prefix !! 151 #define BTF_SET_START(name) static struct btf_id_set name = { 0 };
166 #define BTF_SET_START(name) static struct btf_ !! 152 #define BTF_SET_START_GLOBAL(name) static struct btf_id_set name = { 0 };
167 #define BTF_SET_START_GLOBAL(name) static stru << 
168 #define BTF_SET_END(name)                         153 #define BTF_SET_END(name)
169                                                   154 
170 #endif /* CONFIG_DEBUG_INFO_BTF */                155 #endif /* CONFIG_DEBUG_INFO_BTF */
171                                                   156 
172 #ifdef CONFIG_NET                                 157 #ifdef CONFIG_NET
173 /* Define a list of socket types which can be     158 /* Define a list of socket types which can be the argument for
174  * skc_to_*_sock() helpers. All these sockets     159  * skc_to_*_sock() helpers. All these sockets should have
175  * sock_common as the first argument in its me    160  * sock_common as the first argument in its memory layout.
176  */                                               161  */
177 #define BTF_SOCK_TYPE_xxx \                       162 #define BTF_SOCK_TYPE_xxx \
178         BTF_SOCK_TYPE(BTF_SOCK_TYPE_INET, inet    163         BTF_SOCK_TYPE(BTF_SOCK_TYPE_INET, inet_sock)                    \
179         BTF_SOCK_TYPE(BTF_SOCK_TYPE_INET_CONN,    164         BTF_SOCK_TYPE(BTF_SOCK_TYPE_INET_CONN, inet_connection_sock)    \
180         BTF_SOCK_TYPE(BTF_SOCK_TYPE_INET_REQ,     165         BTF_SOCK_TYPE(BTF_SOCK_TYPE_INET_REQ, inet_request_sock)        \
181         BTF_SOCK_TYPE(BTF_SOCK_TYPE_INET_TW, i    166         BTF_SOCK_TYPE(BTF_SOCK_TYPE_INET_TW, inet_timewait_sock)        \
182         BTF_SOCK_TYPE(BTF_SOCK_TYPE_REQ, reque    167         BTF_SOCK_TYPE(BTF_SOCK_TYPE_REQ, request_sock)                  \
183         BTF_SOCK_TYPE(BTF_SOCK_TYPE_SOCK, sock    168         BTF_SOCK_TYPE(BTF_SOCK_TYPE_SOCK, sock)                         \
184         BTF_SOCK_TYPE(BTF_SOCK_TYPE_SOCK_COMMO    169         BTF_SOCK_TYPE(BTF_SOCK_TYPE_SOCK_COMMON, sock_common)           \
185         BTF_SOCK_TYPE(BTF_SOCK_TYPE_TCP, tcp_s    170         BTF_SOCK_TYPE(BTF_SOCK_TYPE_TCP, tcp_sock)                      \
186         BTF_SOCK_TYPE(BTF_SOCK_TYPE_TCP_REQ, t    171         BTF_SOCK_TYPE(BTF_SOCK_TYPE_TCP_REQ, tcp_request_sock)          \
187         BTF_SOCK_TYPE(BTF_SOCK_TYPE_TCP_TW, tc    172         BTF_SOCK_TYPE(BTF_SOCK_TYPE_TCP_TW, tcp_timewait_sock)          \
188         BTF_SOCK_TYPE(BTF_SOCK_TYPE_TCP6, tcp6    173         BTF_SOCK_TYPE(BTF_SOCK_TYPE_TCP6, tcp6_sock)                    \
189         BTF_SOCK_TYPE(BTF_SOCK_TYPE_UDP, udp_s    174         BTF_SOCK_TYPE(BTF_SOCK_TYPE_UDP, udp_sock)                      \
190         BTF_SOCK_TYPE(BTF_SOCK_TYPE_UDP6, udp6 !! 175         BTF_SOCK_TYPE(BTF_SOCK_TYPE_UDP6, udp6_sock)
191         BTF_SOCK_TYPE(BTF_SOCK_TYPE_UNIX, unix << 
192         BTF_SOCK_TYPE(BTF_SOCK_TYPE_MPTCP, mpt << 
193         BTF_SOCK_TYPE(BTF_SOCK_TYPE_SOCKET, so << 
194                                                   176 
195 enum {                                            177 enum {
196 #define BTF_SOCK_TYPE(name, str) name,            178 #define BTF_SOCK_TYPE(name, str) name,
197 BTF_SOCK_TYPE_xxx                                 179 BTF_SOCK_TYPE_xxx
198 #undef BTF_SOCK_TYPE                              180 #undef BTF_SOCK_TYPE
199 MAX_BTF_SOCK_TYPE,                                181 MAX_BTF_SOCK_TYPE,
200 };                                                182 };
201                                                   183 
202 extern u32 btf_sock_ids[];                        184 extern u32 btf_sock_ids[];
203 #endif                                            185 #endif
204                                                << 
205 #define BTF_TRACING_TYPE_xxx    \              << 
206         BTF_TRACING_TYPE(BTF_TRACING_TYPE_TASK << 
207         BTF_TRACING_TYPE(BTF_TRACING_TYPE_FILE << 
208         BTF_TRACING_TYPE(BTF_TRACING_TYPE_VMA, << 
209                                                << 
210 enum {                                         << 
211 #define BTF_TRACING_TYPE(name, type) name,     << 
212 BTF_TRACING_TYPE_xxx                           << 
213 #undef BTF_TRACING_TYPE                        << 
214 MAX_BTF_TRACING_TYPE,                          << 
215 };                                             << 
216                                                << 
217 extern u32 btf_tracing_ids[];                  << 
218                                                   186 
219 #endif                                            187 #endif
220                                                   188 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php