diff options
Diffstat (limited to 'kernel/trace/trace_output.c')
| -rw-r--r-- | kernel/trace/trace_output.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index 7136420603aa..a4840c260c89 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c | |||
| @@ -15,6 +15,9 @@ | |||
| 15 | #define EVENT_HASHSIZE 128 | 15 | #define EVENT_HASHSIZE 128 |
| 16 | 16 | ||
| 17 | static DECLARE_RWSEM(trace_event_mutex); | 17 | static DECLARE_RWSEM(trace_event_mutex); |
| 18 | |||
| 19 | DEFINE_PER_CPU(struct trace_seq, ftrace_event_seq); | ||
| 20 | |||
| 18 | static struct hlist_head event_hash[EVENT_HASHSIZE] __read_mostly; | 21 | static struct hlist_head event_hash[EVENT_HASHSIZE] __read_mostly; |
| 19 | 22 | ||
| 20 | static int next_event_type = __TRACE_LAST_TYPE + 1; | 23 | static int next_event_type = __TRACE_LAST_TYPE + 1; |
| @@ -212,6 +215,42 @@ int trace_seq_path(struct trace_seq *s, struct path *path) | |||
| 212 | return 0; | 215 | return 0; |
| 213 | } | 216 | } |
| 214 | 217 | ||
| 218 | const char * | ||
| 219 | ftrace_print_flags_seq(struct trace_seq *p, const char *delim, | ||
| 220 | unsigned long flags, | ||
| 221 | const struct trace_print_flags *flag_array) | ||
| 222 | { | ||
| 223 | unsigned long mask; | ||
| 224 | const char *str; | ||
| 225 | int i; | ||
| 226 | |||
| 227 | trace_seq_init(p); | ||
| 228 | |||
| 229 | for (i = 0; flag_array[i].name && flags; i++) { | ||
| 230 | |||
| 231 | mask = flag_array[i].mask; | ||
| 232 | if ((flags & mask) != mask) | ||
| 233 | continue; | ||
| 234 | |||
| 235 | str = flag_array[i].name; | ||
| 236 | flags &= ~mask; | ||
| 237 | if (p->len && delim) | ||
| 238 | trace_seq_puts(p, delim); | ||
| 239 | trace_seq_puts(p, str); | ||
| 240 | } | ||
| 241 | |||
| 242 | /* check for left over flags */ | ||
| 243 | if (flags) { | ||
| 244 | if (p->len && delim) | ||
| 245 | trace_seq_puts(p, delim); | ||
| 246 | trace_seq_printf(p, "0x%lx", flags); | ||
| 247 | } | ||
| 248 | |||
| 249 | trace_seq_putc(p, 0); | ||
| 250 | |||
| 251 | return p->buffer; | ||
| 252 | } | ||
| 253 | |||
| 215 | #ifdef CONFIG_KRETPROBES | 254 | #ifdef CONFIG_KRETPROBES |
| 216 | static inline const char *kretprobed(const char *name) | 255 | static inline const char *kretprobed(const char *name) |
| 217 | { | 256 | { |
