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

TOMOYO Linux Cross Reference
Linux/tools/perf/util/jitdump.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/perf/util/jitdump.h (Version linux-6.12-rc7) and /tools/perf/util/jitdump.h (Version linux-4.10.17)


  1 /* SPDX-License-Identifier: GPL-2.0-only */    << 
  2 /*                                                  1 /*
  3  * jitdump.h: jitted code info encapsulation f      2  * jitdump.h: jitted code info encapsulation file format
  4  *                                                  3  *
  5  * Adapted from OProfile GPLv2 support jidump.      4  * Adapted from OProfile GPLv2 support jidump.h:
  6  * Copyright 2007 OProfile authors                  5  * Copyright 2007 OProfile authors
  7  * Jens Wilke                                       6  * Jens Wilke
  8  * Daniel Hansel                                    7  * Daniel Hansel
  9  * Copyright IBM Corporation 2007                   8  * Copyright IBM Corporation 2007
 10  */                                                 9  */
 11 #ifndef JITDUMP_H                                  10 #ifndef JITDUMP_H
 12 #define JITDUMP_H                                  11 #define JITDUMP_H
 13                                                    12 
 14 #include <sys/time.h>                              13 #include <sys/time.h>
 15 #include <time.h>                                  14 #include <time.h>
 16 #include <stdint.h>                                15 #include <stdint.h>
 17                                                    16 
 18 /* JiTD */                                         17 /* JiTD */
 19 #define JITHEADER_MAGIC         0x4A695444         18 #define JITHEADER_MAGIC         0x4A695444
 20 #define JITHEADER_MAGIC_SW      0x4454694A         19 #define JITHEADER_MAGIC_SW      0x4454694A
 21                                                    20 
 22 #define PADDING_8ALIGNED(x) ((((x) + 7) & 7) ^     21 #define PADDING_8ALIGNED(x) ((((x) + 7) & 7) ^ 7)
 23 #define ALIGN_8(x) (((x) + 7) & (~7))              22 #define ALIGN_8(x) (((x) + 7) & (~7))
 24                                                    23 
 25 #define JITHEADER_VERSION 1                        24 #define JITHEADER_VERSION 1
 26                                                    25 
 27 enum jitdump_flags_bits {                          26 enum jitdump_flags_bits {
 28         JITDUMP_FLAGS_ARCH_TIMESTAMP_BIT,          27         JITDUMP_FLAGS_ARCH_TIMESTAMP_BIT,
 29         JITDUMP_FLAGS_MAX_BIT,                     28         JITDUMP_FLAGS_MAX_BIT,
 30 };                                                 29 };
 31                                                    30 
 32 #define JITDUMP_FLAGS_ARCH_TIMESTAMP    (1ULL      31 #define JITDUMP_FLAGS_ARCH_TIMESTAMP    (1ULL << JITDUMP_FLAGS_ARCH_TIMESTAMP_BIT)
 33                                                    32 
 34 #define JITDUMP_FLAGS_RESERVED (JITDUMP_FLAGS_     33 #define JITDUMP_FLAGS_RESERVED (JITDUMP_FLAGS_MAX_BIT < 64 ? \
 35                                 (~((1ULL << JI     34                                 (~((1ULL << JITDUMP_FLAGS_MAX_BIT) - 1)) : 0)
 36                                                    35 
 37 struct jitheader {                                 36 struct jitheader {
 38         uint32_t magic;         /* characters      37         uint32_t magic;         /* characters "jItD" */
 39         uint32_t version;       /* header vers     38         uint32_t version;       /* header version */
 40         uint32_t total_size;    /* total size      39         uint32_t total_size;    /* total size of header */
 41         uint32_t elf_mach;      /* elf mach ta     40         uint32_t elf_mach;      /* elf mach target */
 42         uint32_t pad1;          /* reserved */     41         uint32_t pad1;          /* reserved */
 43         uint32_t pid;           /* JIT process     42         uint32_t pid;           /* JIT process id */
 44         uint64_t timestamp;     /* timestamp *     43         uint64_t timestamp;     /* timestamp */
 45         uint64_t flags;         /* flags */        44         uint64_t flags;         /* flags */
 46 };                                                 45 };
 47                                                    46 
 48 enum jit_record_type {                             47 enum jit_record_type {
 49         JIT_CODE_LOAD           = 0,               48         JIT_CODE_LOAD           = 0,
 50         JIT_CODE_MOVE           = 1,               49         JIT_CODE_MOVE           = 1,
 51         JIT_CODE_DEBUG_INFO     = 2,               50         JIT_CODE_DEBUG_INFO     = 2,
 52         JIT_CODE_CLOSE          = 3,               51         JIT_CODE_CLOSE          = 3,
 53         JIT_CODE_UNWINDING_INFO = 4,               52         JIT_CODE_UNWINDING_INFO = 4,
 54                                                    53 
 55         JIT_CODE_MAX,                              54         JIT_CODE_MAX,
 56 };                                                 55 };
 57                                                    56 
 58 /* record prefix (mandatory in each record) */     57 /* record prefix (mandatory in each record) */
 59 struct jr_prefix {                                 58 struct jr_prefix {
 60         uint32_t id;                               59         uint32_t id;
 61         uint32_t total_size;                       60         uint32_t total_size;
 62         uint64_t timestamp;                        61         uint64_t timestamp;
 63 };                                                 62 };
 64                                                    63 
 65 struct jr_code_load {                              64 struct jr_code_load {
 66         struct jr_prefix p;                        65         struct jr_prefix p;
 67                                                    66 
 68         uint32_t pid;                              67         uint32_t pid;
 69         uint32_t tid;                              68         uint32_t tid;
 70         uint64_t vma;                              69         uint64_t vma;
 71         uint64_t code_addr;                        70         uint64_t code_addr;
 72         uint64_t code_size;                        71         uint64_t code_size;
 73         uint64_t code_index;                       72         uint64_t code_index;
 74 };                                                 73 };
 75                                                    74 
 76 struct jr_code_close {                             75 struct jr_code_close {
 77         struct jr_prefix p;                        76         struct jr_prefix p;
 78 };                                                 77 };
 79                                                    78 
 80 struct jr_code_move {                              79 struct jr_code_move {
 81         struct jr_prefix p;                        80         struct jr_prefix p;
 82                                                    81 
 83         uint32_t pid;                              82         uint32_t pid;
 84         uint32_t tid;                              83         uint32_t tid;
 85         uint64_t vma;                              84         uint64_t vma;
 86         uint64_t old_code_addr;                    85         uint64_t old_code_addr;
 87         uint64_t new_code_addr;                    86         uint64_t new_code_addr;
 88         uint64_t code_size;                        87         uint64_t code_size;
 89         uint64_t code_index;                       88         uint64_t code_index;
 90 };                                                 89 };
 91                                                    90 
 92 struct debug_entry {                               91 struct debug_entry {
 93         uint64_t addr;                             92         uint64_t addr;
 94         int lineno;         /* source line num     93         int lineno;         /* source line number starting at 1 */
 95         int discrim;        /* column discrimi     94         int discrim;        /* column discriminator, 0 is default */
 96         const char name[]; /* null terminated  !!  95         const char name[0]; /* null terminated filename, \xff\0 if same as previous entry */
 97 };                                                 96 };
 98                                                    97 
 99 struct jr_code_debug_info {                        98 struct jr_code_debug_info {
100         struct jr_prefix p;                        99         struct jr_prefix p;
101                                                   100 
102         uint64_t code_addr;                       101         uint64_t code_addr;
103         uint64_t nr_entry;                        102         uint64_t nr_entry;
104         struct debug_entry entries[];          !! 103         struct debug_entry entries[0];
105 };                                                104 };
106                                                   105 
107 struct jr_code_unwinding_info {                   106 struct jr_code_unwinding_info {
108         struct jr_prefix p;                       107         struct jr_prefix p;
109                                                   108 
110         uint64_t unwinding_size;                  109         uint64_t unwinding_size;
111         uint64_t eh_frame_hdr_size;               110         uint64_t eh_frame_hdr_size;
112         uint64_t mapped_size;                     111         uint64_t mapped_size;
113         const char unwinding_data[];           !! 112         const char unwinding_data[0];
114 };                                                113 };
115                                                   114 
116 union jr_entry {                                  115 union jr_entry {
117         struct jr_code_debug_info info;           116         struct jr_code_debug_info info;
118         struct jr_code_close close;               117         struct jr_code_close close;
119         struct jr_code_load load;                 118         struct jr_code_load load;
120         struct jr_code_move move;                 119         struct jr_code_move move;
121         struct jr_prefix prefix;                  120         struct jr_prefix prefix;
122         struct jr_code_unwinding_info unwindin    121         struct jr_code_unwinding_info unwinding;
123 };                                                122 };
124                                                   123 
125 static inline struct debug_entry *                124 static inline struct debug_entry *
126 debug_entry_next(struct debug_entry *ent)         125 debug_entry_next(struct debug_entry *ent)
127 {                                                 126 {
128         void *a = ent + 1;                        127         void *a = ent + 1;
129         size_t l = strlen(ent->name) + 1;         128         size_t l = strlen(ent->name) + 1;
130         return a + l;                             129         return a + l;
131 }                                                 130 }
132                                                   131 
133 static inline char *                              132 static inline char *
134 debug_entry_file(struct debug_entry *ent)         133 debug_entry_file(struct debug_entry *ent)
135 {                                                 134 {
136         void *a = ent + 1;                        135         void *a = ent + 1;
137         return a;                                 136         return a;
138 }                                                 137 }
139                                                   138 
140 #endif /* !JITDUMP_H */                           139 #endif /* !JITDUMP_H */
141                                                   140 

~ [ 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