^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * This file defines the trace event structures that go into the ring
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * buffer directly. They are created via macros so that changes for them
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * appear in the format file. Using macros will automate this process.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * The macro used to create a ftrace data structure is:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * FTRACE_ENTRY( name, struct_name, id, structure, print )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * @name: the name used the event name, as well as the name of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * the directory that holds the format file.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * @struct_name: the name of the structure that is created.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * @id: The event identifier that is used to detect what event
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * this is from the ring buffer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * @structure: the structure layout
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) * - __field( type, item )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * This is equivalent to declaring
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) * type item;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) * in the structure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) * - __array( type, item, size )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) * This is equivalent to declaring
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) * type item[size];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) * in the structure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) * * for structures within structures, the format of the internal
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) * structure is laid out. This allows the internal structure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) * to be deciphered for the format file. Although these macros
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) * may become out of sync with the internal structure, they
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) * will create a compile error if it happens. Since the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) * internel structures are just tracing helpers, this is not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) * an issue.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) * When an internal structure is used, it should use:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) * __field_struct( type, item )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) * instead of __field. This will prevent it from being shown in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) * the output file. The fields in the structure should use.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) * __field_desc( type, container, item )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) * __array_desc( type, container, item, len )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) * type, item and len are the same as __field and __array, but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) * container is added. This is the name of the item in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) * __field_struct that this is describing.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) * @print: the print format shown to users in the format file.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) * Function trace entry - function address and parent function address:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) FTRACE_ENTRY_REG(function, ftrace_entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) TRACE_FN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) F_STRUCT(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) __field_fn( unsigned long, ip )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) __field_fn( unsigned long, parent_ip )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) F_printk(" %ps <-- %ps",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) (void *)__entry->ip, (void *)__entry->parent_ip),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) perf_ftrace_event_register
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) /* Function call entry */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) FTRACE_ENTRY_PACKED(funcgraph_entry, ftrace_graph_ent_entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) TRACE_GRAPH_ENT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) F_STRUCT(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) __field_struct( struct ftrace_graph_ent, graph_ent )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) __field_packed( unsigned long, graph_ent, func )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) __field_packed( int, graph_ent, depth )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) F_printk("--> %ps (%d)", (void *)__entry->func, __entry->depth)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) /* Function return entry */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) FTRACE_ENTRY_PACKED(funcgraph_exit, ftrace_graph_ret_entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) TRACE_GRAPH_RET,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) F_STRUCT(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) __field_struct( struct ftrace_graph_ret, ret )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) __field_packed( unsigned long, ret, func )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) __field_packed( unsigned long, ret, overrun )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) __field_packed( unsigned long long, ret, calltime)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) __field_packed( unsigned long long, ret, rettime )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) __field_packed( int, ret, depth )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) F_printk("<-- %ps (%d) (start: %llx end: %llx) over: %d",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) (void *)__entry->func, __entry->depth,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) __entry->calltime, __entry->rettime,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) __entry->depth)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) * Context switch trace entry - which task (and prio) we switched from/to:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) * This is used for both wakeup and context switches. We only want
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) * to create one structure, but we need two outputs for it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) #define FTRACE_CTX_FIELDS \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) __field( unsigned int, prev_pid ) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) __field( unsigned int, next_pid ) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) __field( unsigned int, next_cpu ) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) __field( unsigned char, prev_prio ) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) __field( unsigned char, prev_state ) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) __field( unsigned char, next_prio ) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) __field( unsigned char, next_state )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) FTRACE_ENTRY(context_switch, ctx_switch_entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) TRACE_CTX,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) F_STRUCT(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) FTRACE_CTX_FIELDS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) F_printk("%u:%u:%u ==> %u:%u:%u [%03u]",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) __entry->prev_pid, __entry->prev_prio, __entry->prev_state,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) __entry->next_pid, __entry->next_prio, __entry->next_state,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) __entry->next_cpu)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) * FTRACE_ENTRY_DUP only creates the format file, it will not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) * create another structure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) FTRACE_ENTRY_DUP(wakeup, ctx_switch_entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) TRACE_WAKE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) F_STRUCT(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) FTRACE_CTX_FIELDS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) F_printk("%u:%u:%u ==+ %u:%u:%u [%03u]",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) __entry->prev_pid, __entry->prev_prio, __entry->prev_state,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) __entry->next_pid, __entry->next_prio, __entry->next_state,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) __entry->next_cpu)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) * Stack-trace entry:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) #define FTRACE_STACK_ENTRIES 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) FTRACE_ENTRY(kernel_stack, stack_entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) TRACE_STACK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) F_STRUCT(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) __field( int, size )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) __array( unsigned long, caller, FTRACE_STACK_ENTRIES )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) F_printk("\t=> %ps\n\t=> %ps\n\t=> %ps\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) "\t=> %ps\n\t=> %ps\n\t=> %ps\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) "\t=> %ps\n\t=> %ps\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) (void *)__entry->caller[0], (void *)__entry->caller[1],
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) (void *)__entry->caller[2], (void *)__entry->caller[3],
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) (void *)__entry->caller[4], (void *)__entry->caller[5],
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) (void *)__entry->caller[6], (void *)__entry->caller[7])
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) FTRACE_ENTRY(user_stack, userstack_entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) TRACE_USER_STACK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) F_STRUCT(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) __field( unsigned int, tgid )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) __array( unsigned long, caller, FTRACE_STACK_ENTRIES )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) F_printk("\t=> %ps\n\t=> %ps\n\t=> %ps\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) "\t=> %ps\n\t=> %ps\n\t=> %ps\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) "\t=> %ps\n\t=> %ps\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) (void *)__entry->caller[0], (void *)__entry->caller[1],
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) (void *)__entry->caller[2], (void *)__entry->caller[3],
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) (void *)__entry->caller[4], (void *)__entry->caller[5],
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) (void *)__entry->caller[6], (void *)__entry->caller[7])
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) * trace_printk entry:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) FTRACE_ENTRY(bprint, bprint_entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) TRACE_BPRINT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) F_STRUCT(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) __field( unsigned long, ip )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) __field( const char *, fmt )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) __dynamic_array( u32, buf )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) F_printk("%ps: %s",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) (void *)__entry->ip, __entry->fmt)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) FTRACE_ENTRY_REG(print, print_entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) TRACE_PRINT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) F_STRUCT(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) __field( unsigned long, ip )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) __dynamic_array( char, buf )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) F_printk("%ps: %s",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) (void *)__entry->ip, __entry->buf),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) ftrace_event_register
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) FTRACE_ENTRY(raw_data, raw_data_entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) TRACE_RAW_DATA,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) F_STRUCT(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) __field( unsigned int, id )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) __dynamic_array( char, buf )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) F_printk("id:%04x %08x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) __entry->id, (int)__entry->buf[0])
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) FTRACE_ENTRY(bputs, bputs_entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) TRACE_BPUTS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) F_STRUCT(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) __field( unsigned long, ip )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) __field( const char *, str )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) F_printk("%ps: %s",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) (void *)__entry->ip, __entry->str)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) FTRACE_ENTRY(mmiotrace_rw, trace_mmiotrace_rw,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) TRACE_MMIO_RW,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) F_STRUCT(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) __field_struct( struct mmiotrace_rw, rw )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) __field_desc( resource_size_t, rw, phys )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) __field_desc( unsigned long, rw, value )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) __field_desc( unsigned long, rw, pc )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) __field_desc( int, rw, map_id )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) __field_desc( unsigned char, rw, opcode )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) __field_desc( unsigned char, rw, width )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) F_printk("%lx %lx %lx %d %x %x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) (unsigned long)__entry->phys, __entry->value, __entry->pc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) __entry->map_id, __entry->opcode, __entry->width)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) FTRACE_ENTRY(mmiotrace_map, trace_mmiotrace_map,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) TRACE_MMIO_MAP,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) F_STRUCT(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) __field_struct( struct mmiotrace_map, map )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) __field_desc( resource_size_t, map, phys )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) __field_desc( unsigned long, map, virt )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) __field_desc( unsigned long, map, len )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) __field_desc( int, map, map_id )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) __field_desc( unsigned char, map, opcode )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) F_printk("%lx %lx %lx %d %x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) (unsigned long)__entry->phys, __entry->virt, __entry->len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) __entry->map_id, __entry->opcode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) #define TRACE_FUNC_SIZE 30
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) #define TRACE_FILE_SIZE 20
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) FTRACE_ENTRY(branch, trace_branch,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) TRACE_BRANCH,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) F_STRUCT(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) __field( unsigned int, line )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) __array( char, func, TRACE_FUNC_SIZE+1 )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) __array( char, file, TRACE_FILE_SIZE+1 )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) __field( char, correct )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) __field( char, constant )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) F_printk("%u:%s:%s (%u)%s",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) __entry->line,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) __entry->func, __entry->file, __entry->correct,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) __entry->constant ? " CONSTANT" : "")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) FTRACE_ENTRY(hwlat, hwlat_entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) TRACE_HWLAT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) F_STRUCT(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) __field( u64, duration )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) __field( u64, outer_duration )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) __field( u64, nmi_total_ts )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) __field_struct( struct timespec64, timestamp )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) __field_desc( s64, timestamp, tv_sec )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) __field_desc( long, timestamp, tv_nsec )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) __field( unsigned int, nmi_count )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) __field( unsigned int, seqnum )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) __field( unsigned int, count )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) F_printk("cnt:%u\tts:%010llu.%010lu\tinner:%llu\touter:%llu\tcount:%d\tnmi-ts:%llu\tnmi-count:%u\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) __entry->seqnum,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) __entry->tv_sec,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) __entry->tv_nsec,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) __entry->duration,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) __entry->outer_duration,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) __entry->count,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) __entry->nmi_total_ts,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) __entry->nmi_count)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) );