yuezonghe | 824eb0c | 2024-06-27 02:32:26 -0700 | [diff] [blame] | 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM hist |
| 3 | |
| 4 | #if !defined(_TRACE_HIST_H) || defined(TRACE_HEADER_MULTI_READ) |
| 5 | #define _TRACE_HIST_H |
| 6 | |
| 7 | #include "latency_hist.h" |
| 8 | #include <linux/tracepoint.h> |
| 9 | |
| 10 | #if !defined(CONFIG_PREEMPT_OFF_HIST) && !defined(CONFIG_INTERRUPT_OFF_HIST) |
| 11 | #define trace_preemptirqsoff_hist(a,b) |
| 12 | #define trace_preemptirqsoff_hist_rcuidle(a, b) |
| 13 | #else |
| 14 | TRACE_EVENT(preemptirqsoff_hist, |
| 15 | |
| 16 | TP_PROTO(int reason, int starthist), |
| 17 | |
| 18 | TP_ARGS(reason, starthist), |
| 19 | |
| 20 | TP_STRUCT__entry( |
| 21 | __field(int, reason ) |
| 22 | __field(int, starthist ) |
| 23 | ), |
| 24 | |
| 25 | TP_fast_assign( |
| 26 | __entry->reason = reason; |
| 27 | __entry->starthist = starthist; |
| 28 | ), |
| 29 | |
| 30 | TP_printk("reason=%s starthist=%s", getaction(__entry->reason), |
| 31 | __entry->starthist ? "start" : "stop") |
| 32 | ); |
| 33 | #endif |
| 34 | |
| 35 | #ifndef CONFIG_MISSED_TIMER_OFFSETS_HIST |
| 36 | #define trace_hrtimer_interrupt(a,b,c,d) |
| 37 | #else |
| 38 | TRACE_EVENT(hrtimer_interrupt, |
| 39 | |
| 40 | TP_PROTO(int cpu, long long offset, struct task_struct *curr, struct task_struct *task), |
| 41 | |
| 42 | TP_ARGS(cpu, offset, curr, task), |
| 43 | |
| 44 | TP_STRUCT__entry( |
| 45 | __field(int, cpu ) |
| 46 | __field(long long, offset ) |
| 47 | __array(char, ccomm, TASK_COMM_LEN) |
| 48 | __field(int, cprio ) |
| 49 | __array(char, tcomm, TASK_COMM_LEN) |
| 50 | __field(int, tprio ) |
| 51 | ), |
| 52 | |
| 53 | TP_fast_assign( |
| 54 | __entry->cpu = cpu; |
| 55 | __entry->offset = offset; |
| 56 | memcpy(__entry->ccomm, curr->comm, TASK_COMM_LEN); |
| 57 | __entry->cprio = curr->prio; |
| 58 | memcpy(__entry->tcomm, task != NULL ? task->comm : "<none>", task != NULL ? TASK_COMM_LEN : 7); |
| 59 | __entry->tprio = task != NULL ? task->prio : -1; |
| 60 | ), |
| 61 | |
| 62 | TP_printk("cpu=%d offset=%lld curr=%s[%d] thread=%s[%d]", |
| 63 | __entry->cpu, __entry->offset, __entry->ccomm, __entry->cprio, __entry->tcomm, __entry->tprio) |
| 64 | ); |
| 65 | #endif |
| 66 | |
| 67 | #endif /* _TRACE_HIST_H */ |
| 68 | |
| 69 | /* This part must be outside protection */ |
| 70 | #include <trace/define_trace.h> |