diff options
| author | Ingo Molnar <mingo@elte.hu> | 2012-02-17 06:55:07 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2012-02-17 06:55:07 -0500 |
| commit | 09bda4432a8a4d4db2b2b94697abc8d732a9ff73 (patch) | |
| tree | 8449aac6af302967dcbabdfb315bf691491a4241 /include/trace | |
| parent | d1e169da9e20efc0762da6ec160dd7740d0103f5 (diff) | |
| parent | 47b0edcb599ea6eb9ef16d3a08932a0e01485293 (diff) | |
Merge branch 'tip/perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace into perf/core
Diffstat (limited to 'include/trace')
| -rw-r--r-- | include/trace/events/power.h | 2 | ||||
| -rw-r--r-- | include/trace/events/printk.h | 41 |
2 files changed, 43 insertions, 0 deletions
diff --git a/include/trace/events/power.h b/include/trace/events/power.h index 1bcc2a8c00e2..14b38940062b 100644 --- a/include/trace/events/power.h +++ b/include/trace/events/power.h | |||
| @@ -151,6 +151,8 @@ enum { | |||
| 151 | events get removed */ | 151 | events get removed */ |
| 152 | static inline void trace_power_start(u64 type, u64 state, u64 cpuid) {}; | 152 | static inline void trace_power_start(u64 type, u64 state, u64 cpuid) {}; |
| 153 | static inline void trace_power_end(u64 cpuid) {}; | 153 | static inline void trace_power_end(u64 cpuid) {}; |
| 154 | static inline void trace_power_start_rcuidle(u64 type, u64 state, u64 cpuid) {}; | ||
| 155 | static inline void trace_power_end_rcuidle(u64 cpuid) {}; | ||
| 154 | static inline void trace_power_frequency(u64 type, u64 state, u64 cpuid) {}; | 156 | static inline void trace_power_frequency(u64 type, u64 state, u64 cpuid) {}; |
| 155 | #endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */ | 157 | #endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */ |
| 156 | 158 | ||
diff --git a/include/trace/events/printk.h b/include/trace/events/printk.h new file mode 100644 index 000000000000..94ec79cc011a --- /dev/null +++ b/include/trace/events/printk.h | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | #undef TRACE_SYSTEM | ||
| 2 | #define TRACE_SYSTEM printk | ||
| 3 | |||
| 4 | #if !defined(_TRACE_PRINTK_H) || defined(TRACE_HEADER_MULTI_READ) | ||
| 5 | #define _TRACE_PRINTK_H | ||
| 6 | |||
| 7 | #include <linux/tracepoint.h> | ||
| 8 | |||
| 9 | TRACE_EVENT_CONDITION(console, | ||
| 10 | TP_PROTO(const char *log_buf, unsigned start, unsigned end, | ||
| 11 | unsigned log_buf_len), | ||
| 12 | |||
| 13 | TP_ARGS(log_buf, start, end, log_buf_len), | ||
| 14 | |||
| 15 | TP_CONDITION(start != end), | ||
| 16 | |||
| 17 | TP_STRUCT__entry( | ||
| 18 | __dynamic_array(char, msg, end - start + 1) | ||
| 19 | ), | ||
| 20 | |||
| 21 | TP_fast_assign( | ||
| 22 | if ((start & (log_buf_len - 1)) > (end & (log_buf_len - 1))) { | ||
| 23 | memcpy(__get_dynamic_array(msg), | ||
| 24 | log_buf + (start & (log_buf_len - 1)), | ||
| 25 | log_buf_len - (start & (log_buf_len - 1))); | ||
| 26 | memcpy((char *)__get_dynamic_array(msg) + | ||
| 27 | log_buf_len - (start & (log_buf_len - 1)), | ||
| 28 | log_buf, end & (log_buf_len - 1)); | ||
| 29 | } else | ||
| 30 | memcpy(__get_dynamic_array(msg), | ||
| 31 | log_buf + (start & (log_buf_len - 1)), | ||
| 32 | end - start); | ||
| 33 | ((char *)__get_dynamic_array(msg))[end - start] = 0; | ||
| 34 | ), | ||
| 35 | |||
| 36 | TP_printk("%s", __get_str(msg)) | ||
| 37 | ); | ||
| 38 | #endif /* _TRACE_PRINTK_H */ | ||
| 39 | |||
| 40 | /* This part must be outside protection */ | ||
| 41 | #include <trace/define_trace.h> | ||
