1bb730b58SSteven Rostedt (VMware) // SPDX-License-Identifier: GPL-2.0 20a1c49dbSSteven Rostedt /* 30a1c49dbSSteven Rostedt * This file defines the trace event structures that go into the ring 40a1c49dbSSteven Rostedt * buffer directly. They are created via macros so that changes for them 50a1c49dbSSteven Rostedt * appear in the format file. Using macros will automate this process. 60a1c49dbSSteven Rostedt * 70a1c49dbSSteven Rostedt * The macro used to create a ftrace data structure is: 80a1c49dbSSteven Rostedt * 90a1c49dbSSteven Rostedt * FTRACE_ENTRY( name, struct_name, id, structure, print ) 100a1c49dbSSteven Rostedt * 110a1c49dbSSteven Rostedt * @name: the name used the event name, as well as the name of 120a1c49dbSSteven Rostedt * the directory that holds the format file. 130a1c49dbSSteven Rostedt * 140a1c49dbSSteven Rostedt * @struct_name: the name of the structure that is created. 150a1c49dbSSteven Rostedt * 160a1c49dbSSteven Rostedt * @id: The event identifier that is used to detect what event 170a1c49dbSSteven Rostedt * this is from the ring buffer. 180a1c49dbSSteven Rostedt * 190a1c49dbSSteven Rostedt * @structure: the structure layout 200a1c49dbSSteven Rostedt * 210a1c49dbSSteven Rostedt * - __field( type, item ) 220a1c49dbSSteven Rostedt * This is equivalent to declaring 230a1c49dbSSteven Rostedt * type item; 240a1c49dbSSteven Rostedt * in the structure. 250a1c49dbSSteven Rostedt * - __array( type, item, size ) 260a1c49dbSSteven Rostedt * This is equivalent to declaring 270a1c49dbSSteven Rostedt * type item[size]; 280a1c49dbSSteven Rostedt * in the structure. 290a1c49dbSSteven Rostedt * 30d7315094SSteven Rostedt * * for structures within structures, the format of the internal 3125985edcSLucas De Marchi * structure is laid out. This allows the internal structure 32d7315094SSteven Rostedt * to be deciphered for the format file. Although these macros 33d7315094SSteven Rostedt * may become out of sync with the internal structure, they 34d7315094SSteven Rostedt * will create a compile error if it happens. Since the 352b5894ccSQiujun Huang * internal structures are just tracing helpers, this is not 36d7315094SSteven Rostedt * an issue. 37d7315094SSteven Rostedt * 38d7315094SSteven Rostedt * When an internal structure is used, it should use: 39d7315094SSteven Rostedt * 40d7315094SSteven Rostedt * __field_struct( type, item ) 41d7315094SSteven Rostedt * 42d7315094SSteven Rostedt * instead of __field. This will prevent it from being shown in 43d7315094SSteven Rostedt * the output file. The fields in the structure should use. 44d7315094SSteven Rostedt * 45d7315094SSteven Rostedt * __field_desc( type, container, item ) 46d7315094SSteven Rostedt * __array_desc( type, container, item, len ) 47d7315094SSteven Rostedt * 48d7315094SSteven Rostedt * type, item and len are the same as __field and __array, but 49d7315094SSteven Rostedt * container is added. This is the name of the item in 50d7315094SSteven Rostedt * __field_struct that this is describing. 51d7315094SSteven Rostedt * 52d7315094SSteven Rostedt * 530a1c49dbSSteven Rostedt * @print: the print format shown to users in the format file. 540a1c49dbSSteven Rostedt */ 550a1c49dbSSteven Rostedt 560a1c49dbSSteven Rostedt /* 57b595076aSUwe Kleine-König * Function trace entry - function address and parent function address: 580a1c49dbSSteven Rostedt */ 59ced39002SJiri Olsa FTRACE_ENTRY_REG(function, ftrace_entry, 600a1c49dbSSteven Rostedt 610a1c49dbSSteven Rostedt TRACE_FN, 620a1c49dbSSteven Rostedt 630a1c49dbSSteven Rostedt F_STRUCT( 6404ae87a5SPeter Zijlstra __field_fn( unsigned long, ip ) 6504ae87a5SPeter Zijlstra __field_fn( unsigned long, parent_ip ) 660a1c49dbSSteven Rostedt ), 670a1c49dbSSteven Rostedt 6885acbb21SChangbin Du F_printk(" %ps <-- %ps", 6985acbb21SChangbin Du (void *)__entry->ip, (void *)__entry->parent_ip), 70ced39002SJiri Olsa 71ced39002SJiri Olsa perf_ftrace_event_register 720a1c49dbSSteven Rostedt ); 730a1c49dbSSteven Rostedt 740a1c49dbSSteven Rostedt /* Function call entry */ 75a4a551b8SNamhyung Kim FTRACE_ENTRY_PACKED(funcgraph_entry, ftrace_graph_ent_entry, 760a1c49dbSSteven Rostedt 770a1c49dbSSteven Rostedt TRACE_GRAPH_ENT, 780a1c49dbSSteven Rostedt 790a1c49dbSSteven Rostedt F_STRUCT( 80d7315094SSteven Rostedt __field_struct( struct ftrace_graph_ent, graph_ent ) 814649079bSSteven Rostedt (VMware) __field_packed( unsigned long, graph_ent, func ) 824649079bSSteven Rostedt (VMware) __field_packed( int, graph_ent, depth ) 830a1c49dbSSteven Rostedt ), 840a1c49dbSSteven Rostedt 8504ae87a5SPeter Zijlstra F_printk("--> %ps (%d)", (void *)__entry->func, __entry->depth) 860a1c49dbSSteven Rostedt ); 870a1c49dbSSteven Rostedt 880a1c49dbSSteven Rostedt /* Function return entry */ 89a1be9cccSDonglin Peng #ifdef CONFIG_FUNCTION_GRAPH_RETVAL 90a1be9cccSDonglin Peng 91a1be9cccSDonglin Peng FTRACE_ENTRY_PACKED(funcgraph_exit, ftrace_graph_ret_entry, 92a1be9cccSDonglin Peng 93a1be9cccSDonglin Peng TRACE_GRAPH_RET, 94a1be9cccSDonglin Peng 95a1be9cccSDonglin Peng F_STRUCT( 96a1be9cccSDonglin Peng __field_struct( struct ftrace_graph_ret, ret ) 97a1be9cccSDonglin Peng __field_packed( unsigned long, ret, func ) 98a1be9cccSDonglin Peng __field_packed( unsigned long, ret, retval ) 99a1be9cccSDonglin Peng __field_packed( int, ret, depth ) 100a1be9cccSDonglin Peng __field_packed( unsigned int, ret, overrun ) 101a1be9cccSDonglin Peng __field_packed( unsigned long long, ret, calltime) 102a1be9cccSDonglin Peng __field_packed( unsigned long long, ret, rettime ) 103a1be9cccSDonglin Peng ), 104a1be9cccSDonglin Peng 105a1be9cccSDonglin Peng F_printk("<-- %ps (%d) (start: %llx end: %llx) over: %d retval: %lx", 106a1be9cccSDonglin Peng (void *)__entry->func, __entry->depth, 107a1be9cccSDonglin Peng __entry->calltime, __entry->rettime, 108a1be9cccSDonglin Peng __entry->depth, __entry->retval) 109a1be9cccSDonglin Peng ); 110a1be9cccSDonglin Peng 111a1be9cccSDonglin Peng #else 112a1be9cccSDonglin Peng 113a4a551b8SNamhyung Kim FTRACE_ENTRY_PACKED(funcgraph_exit, ftrace_graph_ret_entry, 1140a1c49dbSSteven Rostedt 1150a1c49dbSSteven Rostedt TRACE_GRAPH_RET, 1160a1c49dbSSteven Rostedt 1170a1c49dbSSteven Rostedt F_STRUCT( 118d7315094SSteven Rostedt __field_struct( struct ftrace_graph_ret, ret ) 1194649079bSSteven Rostedt (VMware) __field_packed( unsigned long, ret, func ) 12060602cb5SSteven Rostedt (VMware) __field_packed( int, ret, depth ) 12160602cb5SSteven Rostedt (VMware) __field_packed( unsigned int, ret, overrun ) 1224649079bSSteven Rostedt (VMware) __field_packed( unsigned long long, ret, calltime) 1234649079bSSteven Rostedt (VMware) __field_packed( unsigned long long, ret, rettime ) 1240a1c49dbSSteven Rostedt ), 1250a1c49dbSSteven Rostedt 12685acbb21SChangbin Du F_printk("<-- %ps (%d) (start: %llx end: %llx) over: %d", 12785acbb21SChangbin Du (void *)__entry->func, __entry->depth, 128c16de8fdSLi Zefan __entry->calltime, __entry->rettime, 12904ae87a5SPeter Zijlstra __entry->depth) 1300a1c49dbSSteven Rostedt ); 1310a1c49dbSSteven Rostedt 132a1be9cccSDonglin Peng #endif 133a1be9cccSDonglin Peng 1340a1c49dbSSteven Rostedt /* 1350a1c49dbSSteven Rostedt * Context switch trace entry - which task (and prio) we switched from/to: 1360a1c49dbSSteven Rostedt * 1370a1c49dbSSteven Rostedt * This is used for both wakeup and context switches. We only want 1380a1c49dbSSteven Rostedt * to create one structure, but we need two outputs for it. 1390a1c49dbSSteven Rostedt */ 1400a1c49dbSSteven Rostedt #define FTRACE_CTX_FIELDS \ 1410a1c49dbSSteven Rostedt __field( unsigned int, prev_pid ) \ 142140e4f2dSDavid Sharp __field( unsigned int, next_pid ) \ 143140e4f2dSDavid Sharp __field( unsigned int, next_cpu ) \ 1440a1c49dbSSteven Rostedt __field( unsigned char, prev_prio ) \ 1450a1c49dbSSteven Rostedt __field( unsigned char, prev_state ) \ 1460a1c49dbSSteven Rostedt __field( unsigned char, next_prio ) \ 147140e4f2dSDavid Sharp __field( unsigned char, next_state ) 1480a1c49dbSSteven Rostedt 1490a1c49dbSSteven Rostedt FTRACE_ENTRY(context_switch, ctx_switch_entry, 1500a1c49dbSSteven Rostedt 1510a1c49dbSSteven Rostedt TRACE_CTX, 1520a1c49dbSSteven Rostedt 1530a1c49dbSSteven Rostedt F_STRUCT( 1540a1c49dbSSteven Rostedt FTRACE_CTX_FIELDS 1550a1c49dbSSteven Rostedt ), 1560a1c49dbSSteven Rostedt 157c16de8fdSLi Zefan F_printk("%u:%u:%u ==> %u:%u:%u [%03u]", 1580a1c49dbSSteven Rostedt __entry->prev_pid, __entry->prev_prio, __entry->prev_state, 1590a1c49dbSSteven Rostedt __entry->next_pid, __entry->next_prio, __entry->next_state, 16004ae87a5SPeter Zijlstra __entry->next_cpu) 1610a1c49dbSSteven Rostedt ); 1620a1c49dbSSteven Rostedt 1630a1c49dbSSteven Rostedt /* 1640a1c49dbSSteven Rostedt * FTRACE_ENTRY_DUP only creates the format file, it will not 1650a1c49dbSSteven Rostedt * create another structure. 1660a1c49dbSSteven Rostedt */ 1670a1c49dbSSteven Rostedt FTRACE_ENTRY_DUP(wakeup, ctx_switch_entry, 1680a1c49dbSSteven Rostedt 1690a1c49dbSSteven Rostedt TRACE_WAKE, 1700a1c49dbSSteven Rostedt 1710a1c49dbSSteven Rostedt F_STRUCT( 1720a1c49dbSSteven Rostedt FTRACE_CTX_FIELDS 1730a1c49dbSSteven Rostedt ), 1740a1c49dbSSteven Rostedt 1750a1c49dbSSteven Rostedt F_printk("%u:%u:%u ==+ %u:%u:%u [%03u]", 1760a1c49dbSSteven Rostedt __entry->prev_pid, __entry->prev_prio, __entry->prev_state, 1770a1c49dbSSteven Rostedt __entry->next_pid, __entry->next_prio, __entry->next_state, 17804ae87a5SPeter Zijlstra __entry->next_cpu) 1790a1c49dbSSteven Rostedt ); 1800a1c49dbSSteven Rostedt 1810a1c49dbSSteven Rostedt /* 1820a1c49dbSSteven Rostedt * Stack-trace entry: 1830a1c49dbSSteven Rostedt */ 1840a1c49dbSSteven Rostedt 1850a1c49dbSSteven Rostedt #define FTRACE_STACK_ENTRIES 8 1860a1c49dbSSteven Rostedt 1870a1c49dbSSteven Rostedt FTRACE_ENTRY(kernel_stack, stack_entry, 1880a1c49dbSSteven Rostedt 1890a1c49dbSSteven Rostedt TRACE_STACK, 1900a1c49dbSSteven Rostedt 1910a1c49dbSSteven Rostedt F_STRUCT( 1924a9bd3f1SSteven Rostedt __field( int, size ) 193*e7186af7SSteven Rostedt (Google) __stack_array( unsigned long, caller, FTRACE_STACK_ENTRIES, size) 1940a1c49dbSSteven Rostedt ), 1950a1c49dbSSteven Rostedt 19685acbb21SChangbin Du F_printk("\t=> %ps\n\t=> %ps\n\t=> %ps\n" 19785acbb21SChangbin Du "\t=> %ps\n\t=> %ps\n\t=> %ps\n" 19885acbb21SChangbin Du "\t=> %ps\n\t=> %ps\n", 19985acbb21SChangbin Du (void *)__entry->caller[0], (void *)__entry->caller[1], 20085acbb21SChangbin Du (void *)__entry->caller[2], (void *)__entry->caller[3], 20185acbb21SChangbin Du (void *)__entry->caller[4], (void *)__entry->caller[5], 20204ae87a5SPeter Zijlstra (void *)__entry->caller[6], (void *)__entry->caller[7]) 2030a1c49dbSSteven Rostedt ); 2040a1c49dbSSteven Rostedt 2050a1c49dbSSteven Rostedt FTRACE_ENTRY(user_stack, userstack_entry, 2060a1c49dbSSteven Rostedt 2070a1c49dbSSteven Rostedt TRACE_USER_STACK, 2080a1c49dbSSteven Rostedt 2090a1c49dbSSteven Rostedt F_STRUCT( 2100a1c49dbSSteven Rostedt __field( unsigned int, tgid ) 2110a1c49dbSSteven Rostedt __array( unsigned long, caller, FTRACE_STACK_ENTRIES ) 2120a1c49dbSSteven Rostedt ), 2130a1c49dbSSteven Rostedt 21485acbb21SChangbin Du F_printk("\t=> %ps\n\t=> %ps\n\t=> %ps\n" 21585acbb21SChangbin Du "\t=> %ps\n\t=> %ps\n\t=> %ps\n" 21685acbb21SChangbin Du "\t=> %ps\n\t=> %ps\n", 21785acbb21SChangbin Du (void *)__entry->caller[0], (void *)__entry->caller[1], 21885acbb21SChangbin Du (void *)__entry->caller[2], (void *)__entry->caller[3], 21985acbb21SChangbin Du (void *)__entry->caller[4], (void *)__entry->caller[5], 22004ae87a5SPeter Zijlstra (void *)__entry->caller[6], (void *)__entry->caller[7]) 2210a1c49dbSSteven Rostedt ); 2220a1c49dbSSteven Rostedt 2230a1c49dbSSteven Rostedt /* 2240a1c49dbSSteven Rostedt * trace_printk entry: 2250a1c49dbSSteven Rostedt */ 2260a1c49dbSSteven Rostedt FTRACE_ENTRY(bprint, bprint_entry, 2270a1c49dbSSteven Rostedt 2280a1c49dbSSteven Rostedt TRACE_BPRINT, 2290a1c49dbSSteven Rostedt 2300a1c49dbSSteven Rostedt F_STRUCT( 2310a1c49dbSSteven Rostedt __field( unsigned long, ip ) 2320a1c49dbSSteven Rostedt __field( const char *, fmt ) 2330a1c49dbSSteven Rostedt __dynamic_array( u32, buf ) 2340a1c49dbSSteven Rostedt ), 2350a1c49dbSSteven Rostedt 236bbedb179SScott Wood F_printk("%ps: %s", 23704ae87a5SPeter Zijlstra (void *)__entry->ip, __entry->fmt) 2380a1c49dbSSteven Rostedt ); 2390a1c49dbSSteven Rostedt 2403dd80953SSteven Rostedt (VMware) FTRACE_ENTRY_REG(print, print_entry, 2410a1c49dbSSteven Rostedt 2420a1c49dbSSteven Rostedt TRACE_PRINT, 2430a1c49dbSSteven Rostedt 2440a1c49dbSSteven Rostedt F_STRUCT( 2450a1c49dbSSteven Rostedt __field( unsigned long, ip ) 2460a1c49dbSSteven Rostedt __dynamic_array( char, buf ) 2470a1c49dbSSteven Rostedt ), 2480a1c49dbSSteven Rostedt 249bbedb179SScott Wood F_printk("%ps: %s", 25009ae7234SSteven Rostedt (Red Hat) (void *)__entry->ip, __entry->buf), 25109ae7234SSteven Rostedt (Red Hat) 2523dd80953SSteven Rostedt (VMware) ftrace_event_register 25309ae7234SSteven Rostedt (Red Hat) ); 25409ae7234SSteven Rostedt (Red Hat) 255fa32e855SSteven Rostedt FTRACE_ENTRY(raw_data, raw_data_entry, 256fa32e855SSteven Rostedt 257fa32e855SSteven Rostedt TRACE_RAW_DATA, 258fa32e855SSteven Rostedt 259fa32e855SSteven Rostedt F_STRUCT( 260fa32e855SSteven Rostedt __field( unsigned int, id ) 261fa32e855SSteven Rostedt __dynamic_array( char, buf ) 262fa32e855SSteven Rostedt ), 263fa32e855SSteven Rostedt 264fa32e855SSteven Rostedt F_printk("id:%04x %08x", 26504ae87a5SPeter Zijlstra __entry->id, (int)__entry->buf[0]) 266fa32e855SSteven Rostedt ); 267fa32e855SSteven Rostedt 26809ae7234SSteven Rostedt (Red Hat) FTRACE_ENTRY(bputs, bputs_entry, 26909ae7234SSteven Rostedt (Red Hat) 27009ae7234SSteven Rostedt (Red Hat) TRACE_BPUTS, 27109ae7234SSteven Rostedt (Red Hat) 27209ae7234SSteven Rostedt (Red Hat) F_STRUCT( 27309ae7234SSteven Rostedt (Red Hat) __field( unsigned long, ip ) 27409ae7234SSteven Rostedt (Red Hat) __field( const char *, str ) 27509ae7234SSteven Rostedt (Red Hat) ), 27609ae7234SSteven Rostedt (Red Hat) 277bbedb179SScott Wood F_printk("%ps: %s", 27804ae87a5SPeter Zijlstra (void *)__entry->ip, __entry->str) 2790a1c49dbSSteven Rostedt ); 2800a1c49dbSSteven Rostedt 2810a1c49dbSSteven Rostedt FTRACE_ENTRY(mmiotrace_rw, trace_mmiotrace_rw, 2820a1c49dbSSteven Rostedt 2830a1c49dbSSteven Rostedt TRACE_MMIO_RW, 2840a1c49dbSSteven Rostedt 2850a1c49dbSSteven Rostedt F_STRUCT( 286d7315094SSteven Rostedt __field_struct( struct mmiotrace_rw, rw ) 287d7315094SSteven Rostedt __field_desc( resource_size_t, rw, phys ) 288d7315094SSteven Rostedt __field_desc( unsigned long, rw, value ) 289d7315094SSteven Rostedt __field_desc( unsigned long, rw, pc ) 290d7315094SSteven Rostedt __field_desc( int, rw, map_id ) 291d7315094SSteven Rostedt __field_desc( unsigned char, rw, opcode ) 292d7315094SSteven Rostedt __field_desc( unsigned char, rw, width ) 2930a1c49dbSSteven Rostedt ), 2940a1c49dbSSteven Rostedt 295c16de8fdSLi Zefan F_printk("%lx %lx %lx %d %x %x", 296c16de8fdSLi Zefan (unsigned long)__entry->phys, __entry->value, __entry->pc, 29704ae87a5SPeter Zijlstra __entry->map_id, __entry->opcode, __entry->width) 2980a1c49dbSSteven Rostedt ); 2990a1c49dbSSteven Rostedt 3000a1c49dbSSteven Rostedt FTRACE_ENTRY(mmiotrace_map, trace_mmiotrace_map, 3010a1c49dbSSteven Rostedt 3020a1c49dbSSteven Rostedt TRACE_MMIO_MAP, 3030a1c49dbSSteven Rostedt 3040a1c49dbSSteven Rostedt F_STRUCT( 305d7315094SSteven Rostedt __field_struct( struct mmiotrace_map, map ) 306d7315094SSteven Rostedt __field_desc( resource_size_t, map, phys ) 307d7315094SSteven Rostedt __field_desc( unsigned long, map, virt ) 308d7315094SSteven Rostedt __field_desc( unsigned long, map, len ) 309d7315094SSteven Rostedt __field_desc( int, map, map_id ) 310d7315094SSteven Rostedt __field_desc( unsigned char, map, opcode ) 3110a1c49dbSSteven Rostedt ), 3120a1c49dbSSteven Rostedt 313c16de8fdSLi Zefan F_printk("%lx %lx %lx %d %x", 314c16de8fdSLi Zefan (unsigned long)__entry->phys, __entry->virt, __entry->len, 31504ae87a5SPeter Zijlstra __entry->map_id, __entry->opcode) 3160a1c49dbSSteven Rostedt ); 3170a1c49dbSSteven Rostedt 3180a1c49dbSSteven Rostedt 3190a1c49dbSSteven Rostedt #define TRACE_FUNC_SIZE 30 3200a1c49dbSSteven Rostedt #define TRACE_FILE_SIZE 20 3210a1c49dbSSteven Rostedt 3220a1c49dbSSteven Rostedt FTRACE_ENTRY(branch, trace_branch, 3230a1c49dbSSteven Rostedt 3240a1c49dbSSteven Rostedt TRACE_BRANCH, 3250a1c49dbSSteven Rostedt 3260a1c49dbSSteven Rostedt F_STRUCT( 3270a1c49dbSSteven Rostedt __field( unsigned int, line ) 3280a1c49dbSSteven Rostedt __array( char, func, TRACE_FUNC_SIZE+1 ) 3290a1c49dbSSteven Rostedt __array( char, file, TRACE_FILE_SIZE+1 ) 3300a1c49dbSSteven Rostedt __field( char, correct ) 331068f530bSSteven Rostedt (VMware) __field( char, constant ) 3320a1c49dbSSteven Rostedt ), 3330a1c49dbSSteven Rostedt 334068f530bSSteven Rostedt (VMware) F_printk("%u:%s:%s (%u)%s", 3350a1c49dbSSteven Rostedt __entry->line, 336068f530bSSteven Rostedt (VMware) __entry->func, __entry->file, __entry->correct, 33704ae87a5SPeter Zijlstra __entry->constant ? " CONSTANT" : "") 3380a1c49dbSSteven Rostedt ); 3390a1c49dbSSteven Rostedt 340e7c15cd8SSteven Rostedt (Red Hat) 341e7c15cd8SSteven Rostedt (Red Hat) FTRACE_ENTRY(hwlat, hwlat_entry, 342e7c15cd8SSteven Rostedt (Red Hat) 343e7c15cd8SSteven Rostedt (Red Hat) TRACE_HWLAT, 344e7c15cd8SSteven Rostedt (Red Hat) 345e7c15cd8SSteven Rostedt (Red Hat) F_STRUCT( 346e7c15cd8SSteven Rostedt (Red Hat) __field( u64, duration ) 347e7c15cd8SSteven Rostedt (Red Hat) __field( u64, outer_duration ) 3487b2c8625SSteven Rostedt (Red Hat) __field( u64, nmi_total_ts ) 34951aad0aeSDeepa Dinamani __field_struct( struct timespec64, timestamp ) 35051aad0aeSDeepa Dinamani __field_desc( s64, timestamp, tv_sec ) 351e7c15cd8SSteven Rostedt (Red Hat) __field_desc( long, timestamp, tv_nsec ) 3527b2c8625SSteven Rostedt (Red Hat) __field( unsigned int, nmi_count ) 353e7c15cd8SSteven Rostedt (Red Hat) __field( unsigned int, seqnum ) 354b396bfdeSSteven Rostedt (VMware) __field( unsigned int, count ) 355e7c15cd8SSteven Rostedt (Red Hat) ), 356e7c15cd8SSteven Rostedt (Red Hat) 357b396bfdeSSteven Rostedt (VMware) F_printk("cnt:%u\tts:%010llu.%010lu\tinner:%llu\touter:%llu\tcount:%d\tnmi-ts:%llu\tnmi-count:%u\n", 358e7c15cd8SSteven Rostedt (Red Hat) __entry->seqnum, 359e7c15cd8SSteven Rostedt (Red Hat) __entry->tv_sec, 360e7c15cd8SSteven Rostedt (Red Hat) __entry->tv_nsec, 361e7c15cd8SSteven Rostedt (Red Hat) __entry->duration, 3627b2c8625SSteven Rostedt (Red Hat) __entry->outer_duration, 363b396bfdeSSteven Rostedt (VMware) __entry->count, 3647b2c8625SSteven Rostedt (Red Hat) __entry->nmi_total_ts, 36504ae87a5SPeter Zijlstra __entry->nmi_count) 366e7c15cd8SSteven Rostedt (Red Hat) ); 367f689e4f2SYordan Karadzhov (VMware) 368f689e4f2SYordan Karadzhov (VMware) #define FUNC_REPEATS_GET_DELTA_TS(entry) \ 369f689e4f2SYordan Karadzhov (VMware) (((u64)(entry)->top_delta_ts << 32) | (entry)->bottom_delta_ts) \ 370f689e4f2SYordan Karadzhov (VMware) 371f689e4f2SYordan Karadzhov (VMware) FTRACE_ENTRY(func_repeats, func_repeats_entry, 372f689e4f2SYordan Karadzhov (VMware) 373f689e4f2SYordan Karadzhov (VMware) TRACE_FUNC_REPEATS, 374f689e4f2SYordan Karadzhov (VMware) 375f689e4f2SYordan Karadzhov (VMware) F_STRUCT( 376f689e4f2SYordan Karadzhov (VMware) __field( unsigned long, ip ) 377f689e4f2SYordan Karadzhov (VMware) __field( unsigned long, parent_ip ) 378f689e4f2SYordan Karadzhov (VMware) __field( u16 , count ) 379f689e4f2SYordan Karadzhov (VMware) __field( u16 , top_delta_ts ) 380f689e4f2SYordan Karadzhov (VMware) __field( u32 , bottom_delta_ts ) 381f689e4f2SYordan Karadzhov (VMware) ), 382f689e4f2SYordan Karadzhov (VMware) 383f689e4f2SYordan Karadzhov (VMware) F_printk(" %ps <-%ps\t(repeats:%u delta: -%llu)", 384f689e4f2SYordan Karadzhov (VMware) (void *)__entry->ip, 385f689e4f2SYordan Karadzhov (VMware) (void *)__entry->parent_ip, 386f689e4f2SYordan Karadzhov (VMware) __entry->count, 387f689e4f2SYordan Karadzhov (VMware) FUNC_REPEATS_GET_DELTA_TS(__entry)) 388f689e4f2SYordan Karadzhov (VMware) ); 389bce29ac9SDaniel Bristot de Oliveira 390bce29ac9SDaniel Bristot de Oliveira FTRACE_ENTRY(osnoise, osnoise_entry, 391bce29ac9SDaniel Bristot de Oliveira 392bce29ac9SDaniel Bristot de Oliveira TRACE_OSNOISE, 393bce29ac9SDaniel Bristot de Oliveira 394bce29ac9SDaniel Bristot de Oliveira F_STRUCT( 395bce29ac9SDaniel Bristot de Oliveira __field( u64, noise ) 396bce29ac9SDaniel Bristot de Oliveira __field( u64, runtime ) 397bce29ac9SDaniel Bristot de Oliveira __field( u64, max_sample ) 398bce29ac9SDaniel Bristot de Oliveira __field( unsigned int, hw_count ) 399bce29ac9SDaniel Bristot de Oliveira __field( unsigned int, nmi_count ) 400bce29ac9SDaniel Bristot de Oliveira __field( unsigned int, irq_count ) 401bce29ac9SDaniel Bristot de Oliveira __field( unsigned int, softirq_count ) 402bce29ac9SDaniel Bristot de Oliveira __field( unsigned int, thread_count ) 403bce29ac9SDaniel Bristot de Oliveira ), 404bce29ac9SDaniel Bristot de Oliveira 405bce29ac9SDaniel Bristot de Oliveira F_printk("noise:%llu\tmax_sample:%llu\thw:%u\tnmi:%u\tirq:%u\tsoftirq:%u\tthread:%u\n", 406bce29ac9SDaniel Bristot de Oliveira __entry->noise, 407bce29ac9SDaniel Bristot de Oliveira __entry->max_sample, 408bce29ac9SDaniel Bristot de Oliveira __entry->hw_count, 409bce29ac9SDaniel Bristot de Oliveira __entry->nmi_count, 410bce29ac9SDaniel Bristot de Oliveira __entry->irq_count, 411bce29ac9SDaniel Bristot de Oliveira __entry->softirq_count, 412bce29ac9SDaniel Bristot de Oliveira __entry->thread_count) 413bce29ac9SDaniel Bristot de Oliveira ); 414a955d7eaSDaniel Bristot de Oliveira 415a955d7eaSDaniel Bristot de Oliveira FTRACE_ENTRY(timerlat, timerlat_entry, 416a955d7eaSDaniel Bristot de Oliveira 417a955d7eaSDaniel Bristot de Oliveira TRACE_TIMERLAT, 418a955d7eaSDaniel Bristot de Oliveira 419a955d7eaSDaniel Bristot de Oliveira F_STRUCT( 420a955d7eaSDaniel Bristot de Oliveira __field( unsigned int, seqnum ) 421a955d7eaSDaniel Bristot de Oliveira __field( int, context ) 422a955d7eaSDaniel Bristot de Oliveira __field( u64, timer_latency ) 423a955d7eaSDaniel Bristot de Oliveira ), 424a955d7eaSDaniel Bristot de Oliveira 425a955d7eaSDaniel Bristot de Oliveira F_printk("seq:%u\tcontext:%d\ttimer_latency:%llu\n", 426a955d7eaSDaniel Bristot de Oliveira __entry->seqnum, 427a955d7eaSDaniel Bristot de Oliveira __entry->context, 428a955d7eaSDaniel Bristot de Oliveira __entry->timer_latency) 429a955d7eaSDaniel Bristot de Oliveira ); 430