diff options
-rw-r--r-- | kernel/trace/blktrace.c | 7 | ||||
-rw-r--r-- | kernel/trace/trace.c | 92 | ||||
-rw-r--r-- | kernel/trace/trace.h | 5 | ||||
-rw-r--r-- | kernel/trace/trace_events.c | 3 | ||||
-rw-r--r-- | kernel/trace/trace_functions_graph.c | 50 | ||||
-rw-r--r-- | kernel/trace/trace_irqsoff.c | 28 | ||||
-rw-r--r-- | kernel/trace/trace_kdb.c | 8 | ||||
-rw-r--r-- | kernel/trace/trace_output.c | 14 | ||||
-rw-r--r-- | kernel/trace/trace_sched_wakeup.c | 26 | ||||
-rw-r--r-- | kernel/trace/trace_syscalls.c | 3 |
10 files changed, 135 insertions, 101 deletions
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 973d41d81aa5..b2fcf472774e 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c | |||
@@ -1343,6 +1343,7 @@ static const struct { | |||
1343 | static enum print_line_t print_one_line(struct trace_iterator *iter, | 1343 | static enum print_line_t print_one_line(struct trace_iterator *iter, |
1344 | bool classic) | 1344 | bool classic) |
1345 | { | 1345 | { |
1346 | struct trace_array *tr = iter->tr; | ||
1346 | struct trace_seq *s = &iter->seq; | 1347 | struct trace_seq *s = &iter->seq; |
1347 | const struct blk_io_trace *t; | 1348 | const struct blk_io_trace *t; |
1348 | u16 what; | 1349 | u16 what; |
@@ -1351,7 +1352,7 @@ static enum print_line_t print_one_line(struct trace_iterator *iter, | |||
1351 | 1352 | ||
1352 | t = te_blk_io_trace(iter->ent); | 1353 | t = te_blk_io_trace(iter->ent); |
1353 | what = t->action & ((1 << BLK_TC_SHIFT) - 1); | 1354 | what = t->action & ((1 << BLK_TC_SHIFT) - 1); |
1354 | long_act = !!(trace_flags & TRACE_ITER_VERBOSE); | 1355 | long_act = !!(tr->trace_flags & TRACE_ITER_VERBOSE); |
1355 | log_action = classic ? &blk_log_action_classic : &blk_log_action; | 1356 | log_action = classic ? &blk_log_action_classic : &blk_log_action; |
1356 | 1357 | ||
1357 | if (t->action == BLK_TN_MESSAGE) { | 1358 | if (t->action == BLK_TN_MESSAGE) { |
@@ -1413,9 +1414,9 @@ blk_tracer_set_flag(struct trace_array *tr, u32 old_flags, u32 bit, int set) | |||
1413 | /* don't output context-info for blk_classic output */ | 1414 | /* don't output context-info for blk_classic output */ |
1414 | if (bit == TRACE_BLK_OPT_CLASSIC) { | 1415 | if (bit == TRACE_BLK_OPT_CLASSIC) { |
1415 | if (set) | 1416 | if (set) |
1416 | trace_flags &= ~TRACE_ITER_CONTEXT_INFO; | 1417 | tr->trace_flags &= ~TRACE_ITER_CONTEXT_INFO; |
1417 | else | 1418 | else |
1418 | trace_flags |= TRACE_ITER_CONTEXT_INFO; | 1419 | tr->trace_flags |= TRACE_ITER_CONTEXT_INFO; |
1419 | } | 1420 | } |
1420 | return 0; | 1421 | return 0; |
1421 | } | 1422 | } |
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index e26933c2edaa..4e82f4ad68dc 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -250,6 +250,14 @@ unsigned long long ns2usecs(cycle_t nsec) | |||
250 | return nsec; | 250 | return nsec; |
251 | } | 251 | } |
252 | 252 | ||
253 | /* trace_flags holds trace_options default values */ | ||
254 | #define TRACE_DEFAULT_FLAGS \ | ||
255 | (FUNCTION_DEFAULT_FLAGS | \ | ||
256 | TRACE_ITER_PRINT_PARENT | TRACE_ITER_PRINTK | \ | ||
257 | TRACE_ITER_ANNOTATE | TRACE_ITER_CONTEXT_INFO | \ | ||
258 | TRACE_ITER_RECORD_CMD | TRACE_ITER_OVERWRITE | \ | ||
259 | TRACE_ITER_IRQ_INFO | TRACE_ITER_MARKERS) | ||
260 | |||
253 | /* | 261 | /* |
254 | * The global_trace is the descriptor that holds the tracing | 262 | * The global_trace is the descriptor that holds the tracing |
255 | * buffers for the live tracing. For each CPU, it contains | 263 | * buffers for the live tracing. For each CPU, it contains |
@@ -262,7 +270,9 @@ unsigned long long ns2usecs(cycle_t nsec) | |||
262 | * pages for the buffer for that CPU. Each CPU has the same number | 270 | * pages for the buffer for that CPU. Each CPU has the same number |
263 | * of pages allocated for its buffer. | 271 | * of pages allocated for its buffer. |
264 | */ | 272 | */ |
265 | static struct trace_array global_trace; | 273 | static struct trace_array global_trace = { |
274 | .trace_flags = TRACE_DEFAULT_FLAGS, | ||
275 | }; | ||
266 | 276 | ||
267 | LIST_HEAD(ftrace_trace_arrays); | 277 | LIST_HEAD(ftrace_trace_arrays); |
268 | 278 | ||
@@ -490,15 +500,6 @@ static inline void ftrace_trace_stack(struct ring_buffer *buffer, | |||
490 | 500 | ||
491 | #endif | 501 | #endif |
492 | 502 | ||
493 | /* trace_flags holds trace_options default values */ | ||
494 | unsigned long trace_flags = | ||
495 | FUNCTION_DEFAULT_FLAGS | | ||
496 | TRACE_ITER_PRINT_PARENT | TRACE_ITER_PRINTK | | ||
497 | TRACE_ITER_ANNOTATE | TRACE_ITER_CONTEXT_INFO | | ||
498 | TRACE_ITER_RECORD_CMD | TRACE_ITER_OVERWRITE | | ||
499 | TRACE_ITER_IRQ_INFO | TRACE_ITER_MARKERS | ||
500 | ; | ||
501 | |||
502 | static void tracer_tracing_on(struct trace_array *tr) | 503 | static void tracer_tracing_on(struct trace_array *tr) |
503 | { | 504 | { |
504 | if (tr->trace_buffer.buffer) | 505 | if (tr->trace_buffer.buffer) |
@@ -543,7 +544,7 @@ int __trace_puts(unsigned long ip, const char *str, int size) | |||
543 | int alloc; | 544 | int alloc; |
544 | int pc; | 545 | int pc; |
545 | 546 | ||
546 | if (!(trace_flags & TRACE_ITER_PRINTK)) | 547 | if (!(global_trace.trace_flags & TRACE_ITER_PRINTK)) |
547 | return 0; | 548 | return 0; |
548 | 549 | ||
549 | pc = preempt_count(); | 550 | pc = preempt_count(); |
@@ -593,7 +594,7 @@ int __trace_bputs(unsigned long ip, const char *str) | |||
593 | int size = sizeof(struct bputs_entry); | 594 | int size = sizeof(struct bputs_entry); |
594 | int pc; | 595 | int pc; |
595 | 596 | ||
596 | if (!(trace_flags & TRACE_ITER_PRINTK)) | 597 | if (!(global_trace.trace_flags & TRACE_ITER_PRINTK)) |
597 | return 0; | 598 | return 0; |
598 | 599 | ||
599 | pc = preempt_count(); | 600 | pc = preempt_count(); |
@@ -1875,7 +1876,7 @@ static inline void ftrace_trace_stack(struct ring_buffer *buffer, | |||
1875 | unsigned long flags, | 1876 | unsigned long flags, |
1876 | int skip, int pc, struct pt_regs *regs) | 1877 | int skip, int pc, struct pt_regs *regs) |
1877 | { | 1878 | { |
1878 | if (!(trace_flags & TRACE_ITER_STACKTRACE)) | 1879 | if (!(global_trace.trace_flags & TRACE_ITER_STACKTRACE)) |
1879 | return; | 1880 | return; |
1880 | 1881 | ||
1881 | __ftrace_trace_stack(buffer, flags, skip, pc, regs); | 1882 | __ftrace_trace_stack(buffer, flags, skip, pc, regs); |
@@ -1919,7 +1920,7 @@ ftrace_trace_userstack(struct ring_buffer *buffer, unsigned long flags, int pc) | |||
1919 | struct userstack_entry *entry; | 1920 | struct userstack_entry *entry; |
1920 | struct stack_trace trace; | 1921 | struct stack_trace trace; |
1921 | 1922 | ||
1922 | if (!(trace_flags & TRACE_ITER_USERSTACKTRACE)) | 1923 | if (!(global_trace.trace_flags & TRACE_ITER_USERSTACKTRACE)) |
1923 | return; | 1924 | return; |
1924 | 1925 | ||
1925 | /* | 1926 | /* |
@@ -2236,7 +2237,7 @@ int trace_array_printk(struct trace_array *tr, | |||
2236 | int ret; | 2237 | int ret; |
2237 | va_list ap; | 2238 | va_list ap; |
2238 | 2239 | ||
2239 | if (!(trace_flags & TRACE_ITER_PRINTK)) | 2240 | if (!(global_trace.trace_flags & TRACE_ITER_PRINTK)) |
2240 | return 0; | 2241 | return 0; |
2241 | 2242 | ||
2242 | va_start(ap, fmt); | 2243 | va_start(ap, fmt); |
@@ -2251,7 +2252,7 @@ int trace_array_printk_buf(struct ring_buffer *buffer, | |||
2251 | int ret; | 2252 | int ret; |
2252 | va_list ap; | 2253 | va_list ap; |
2253 | 2254 | ||
2254 | if (!(trace_flags & TRACE_ITER_PRINTK)) | 2255 | if (!(global_trace.trace_flags & TRACE_ITER_PRINTK)) |
2255 | return 0; | 2256 | return 0; |
2256 | 2257 | ||
2257 | va_start(ap, fmt); | 2258 | va_start(ap, fmt); |
@@ -2592,7 +2593,7 @@ static void print_func_help_header_irq(struct trace_buffer *buf, struct seq_file | |||
2592 | void | 2593 | void |
2593 | print_trace_header(struct seq_file *m, struct trace_iterator *iter) | 2594 | print_trace_header(struct seq_file *m, struct trace_iterator *iter) |
2594 | { | 2595 | { |
2595 | unsigned long sym_flags = (trace_flags & TRACE_ITER_SYM_MASK); | 2596 | unsigned long sym_flags = (global_trace.trace_flags & TRACE_ITER_SYM_MASK); |
2596 | struct trace_buffer *buf = iter->trace_buffer; | 2597 | struct trace_buffer *buf = iter->trace_buffer; |
2597 | struct trace_array_cpu *data = per_cpu_ptr(buf->data, buf->cpu); | 2598 | struct trace_array_cpu *data = per_cpu_ptr(buf->data, buf->cpu); |
2598 | struct tracer *type = iter->trace; | 2599 | struct tracer *type = iter->trace; |
@@ -2654,8 +2655,9 @@ print_trace_header(struct seq_file *m, struct trace_iterator *iter) | |||
2654 | static void test_cpu_buff_start(struct trace_iterator *iter) | 2655 | static void test_cpu_buff_start(struct trace_iterator *iter) |
2655 | { | 2656 | { |
2656 | struct trace_seq *s = &iter->seq; | 2657 | struct trace_seq *s = &iter->seq; |
2658 | struct trace_array *tr = iter->tr; | ||
2657 | 2659 | ||
2658 | if (!(trace_flags & TRACE_ITER_ANNOTATE)) | 2660 | if (!(tr->trace_flags & TRACE_ITER_ANNOTATE)) |
2659 | return; | 2661 | return; |
2660 | 2662 | ||
2661 | if (!(iter->iter_flags & TRACE_FILE_ANNOTATE)) | 2663 | if (!(iter->iter_flags & TRACE_FILE_ANNOTATE)) |
@@ -2677,8 +2679,9 @@ static void test_cpu_buff_start(struct trace_iterator *iter) | |||
2677 | 2679 | ||
2678 | static enum print_line_t print_trace_fmt(struct trace_iterator *iter) | 2680 | static enum print_line_t print_trace_fmt(struct trace_iterator *iter) |
2679 | { | 2681 | { |
2682 | struct trace_array *tr = iter->tr; | ||
2680 | struct trace_seq *s = &iter->seq; | 2683 | struct trace_seq *s = &iter->seq; |
2681 | unsigned long sym_flags = (trace_flags & TRACE_ITER_SYM_MASK); | 2684 | unsigned long sym_flags = (tr->trace_flags & TRACE_ITER_SYM_MASK); |
2682 | struct trace_entry *entry; | 2685 | struct trace_entry *entry; |
2683 | struct trace_event *event; | 2686 | struct trace_event *event; |
2684 | 2687 | ||
@@ -2688,7 +2691,7 @@ static enum print_line_t print_trace_fmt(struct trace_iterator *iter) | |||
2688 | 2691 | ||
2689 | event = ftrace_find_event(entry->type); | 2692 | event = ftrace_find_event(entry->type); |
2690 | 2693 | ||
2691 | if (trace_flags & TRACE_ITER_CONTEXT_INFO) { | 2694 | if (tr->trace_flags & TRACE_ITER_CONTEXT_INFO) { |
2692 | if (iter->iter_flags & TRACE_FILE_LAT_FMT) | 2695 | if (iter->iter_flags & TRACE_FILE_LAT_FMT) |
2693 | trace_print_lat_context(iter); | 2696 | trace_print_lat_context(iter); |
2694 | else | 2697 | else |
@@ -2708,13 +2711,14 @@ static enum print_line_t print_trace_fmt(struct trace_iterator *iter) | |||
2708 | 2711 | ||
2709 | static enum print_line_t print_raw_fmt(struct trace_iterator *iter) | 2712 | static enum print_line_t print_raw_fmt(struct trace_iterator *iter) |
2710 | { | 2713 | { |
2714 | struct trace_array *tr = iter->tr; | ||
2711 | struct trace_seq *s = &iter->seq; | 2715 | struct trace_seq *s = &iter->seq; |
2712 | struct trace_entry *entry; | 2716 | struct trace_entry *entry; |
2713 | struct trace_event *event; | 2717 | struct trace_event *event; |
2714 | 2718 | ||
2715 | entry = iter->ent; | 2719 | entry = iter->ent; |
2716 | 2720 | ||
2717 | if (trace_flags & TRACE_ITER_CONTEXT_INFO) | 2721 | if (tr->trace_flags & TRACE_ITER_CONTEXT_INFO) |
2718 | trace_seq_printf(s, "%d %d %llu ", | 2722 | trace_seq_printf(s, "%d %d %llu ", |
2719 | entry->pid, iter->cpu, iter->ts); | 2723 | entry->pid, iter->cpu, iter->ts); |
2720 | 2724 | ||
@@ -2732,6 +2736,7 @@ static enum print_line_t print_raw_fmt(struct trace_iterator *iter) | |||
2732 | 2736 | ||
2733 | static enum print_line_t print_hex_fmt(struct trace_iterator *iter) | 2737 | static enum print_line_t print_hex_fmt(struct trace_iterator *iter) |
2734 | { | 2738 | { |
2739 | struct trace_array *tr = iter->tr; | ||
2735 | struct trace_seq *s = &iter->seq; | 2740 | struct trace_seq *s = &iter->seq; |
2736 | unsigned char newline = '\n'; | 2741 | unsigned char newline = '\n'; |
2737 | struct trace_entry *entry; | 2742 | struct trace_entry *entry; |
@@ -2739,7 +2744,7 @@ static enum print_line_t print_hex_fmt(struct trace_iterator *iter) | |||
2739 | 2744 | ||
2740 | entry = iter->ent; | 2745 | entry = iter->ent; |
2741 | 2746 | ||
2742 | if (trace_flags & TRACE_ITER_CONTEXT_INFO) { | 2747 | if (tr->trace_flags & TRACE_ITER_CONTEXT_INFO) { |
2743 | SEQ_PUT_HEX_FIELD(s, entry->pid); | 2748 | SEQ_PUT_HEX_FIELD(s, entry->pid); |
2744 | SEQ_PUT_HEX_FIELD(s, iter->cpu); | 2749 | SEQ_PUT_HEX_FIELD(s, iter->cpu); |
2745 | SEQ_PUT_HEX_FIELD(s, iter->ts); | 2750 | SEQ_PUT_HEX_FIELD(s, iter->ts); |
@@ -2761,13 +2766,14 @@ static enum print_line_t print_hex_fmt(struct trace_iterator *iter) | |||
2761 | 2766 | ||
2762 | static enum print_line_t print_bin_fmt(struct trace_iterator *iter) | 2767 | static enum print_line_t print_bin_fmt(struct trace_iterator *iter) |
2763 | { | 2768 | { |
2769 | struct trace_array *tr = iter->tr; | ||
2764 | struct trace_seq *s = &iter->seq; | 2770 | struct trace_seq *s = &iter->seq; |
2765 | struct trace_entry *entry; | 2771 | struct trace_entry *entry; |
2766 | struct trace_event *event; | 2772 | struct trace_event *event; |
2767 | 2773 | ||
2768 | entry = iter->ent; | 2774 | entry = iter->ent; |
2769 | 2775 | ||
2770 | if (trace_flags & TRACE_ITER_CONTEXT_INFO) { | 2776 | if (tr->trace_flags & TRACE_ITER_CONTEXT_INFO) { |
2771 | SEQ_PUT_FIELD(s, entry->pid); | 2777 | SEQ_PUT_FIELD(s, entry->pid); |
2772 | SEQ_PUT_FIELD(s, iter->cpu); | 2778 | SEQ_PUT_FIELD(s, iter->cpu); |
2773 | SEQ_PUT_FIELD(s, iter->ts); | 2779 | SEQ_PUT_FIELD(s, iter->ts); |
@@ -2816,6 +2822,8 @@ int trace_empty(struct trace_iterator *iter) | |||
2816 | /* Called with trace_event_read_lock() held. */ | 2822 | /* Called with trace_event_read_lock() held. */ |
2817 | enum print_line_t print_trace_line(struct trace_iterator *iter) | 2823 | enum print_line_t print_trace_line(struct trace_iterator *iter) |
2818 | { | 2824 | { |
2825 | struct trace_array *tr = iter->tr; | ||
2826 | unsigned long trace_flags = tr->trace_flags; | ||
2819 | enum print_line_t ret; | 2827 | enum print_line_t ret; |
2820 | 2828 | ||
2821 | if (iter->lost_events) { | 2829 | if (iter->lost_events) { |
@@ -2861,6 +2869,7 @@ enum print_line_t print_trace_line(struct trace_iterator *iter) | |||
2861 | void trace_latency_header(struct seq_file *m) | 2869 | void trace_latency_header(struct seq_file *m) |
2862 | { | 2870 | { |
2863 | struct trace_iterator *iter = m->private; | 2871 | struct trace_iterator *iter = m->private; |
2872 | struct trace_array *tr = iter->tr; | ||
2864 | 2873 | ||
2865 | /* print nothing if the buffers are empty */ | 2874 | /* print nothing if the buffers are empty */ |
2866 | if (trace_empty(iter)) | 2875 | if (trace_empty(iter)) |
@@ -2869,13 +2878,15 @@ void trace_latency_header(struct seq_file *m) | |||
2869 | if (iter->iter_flags & TRACE_FILE_LAT_FMT) | 2878 | if (iter->iter_flags & TRACE_FILE_LAT_FMT) |
2870 | print_trace_header(m, iter); | 2879 | print_trace_header(m, iter); |
2871 | 2880 | ||
2872 | if (!(trace_flags & TRACE_ITER_VERBOSE)) | 2881 | if (!(tr->trace_flags & TRACE_ITER_VERBOSE)) |
2873 | print_lat_help_header(m); | 2882 | print_lat_help_header(m); |
2874 | } | 2883 | } |
2875 | 2884 | ||
2876 | void trace_default_header(struct seq_file *m) | 2885 | void trace_default_header(struct seq_file *m) |
2877 | { | 2886 | { |
2878 | struct trace_iterator *iter = m->private; | 2887 | struct trace_iterator *iter = m->private; |
2888 | struct trace_array *tr = iter->tr; | ||
2889 | unsigned long trace_flags = tr->trace_flags; | ||
2879 | 2890 | ||
2880 | if (!(trace_flags & TRACE_ITER_CONTEXT_INFO)) | 2891 | if (!(trace_flags & TRACE_ITER_CONTEXT_INFO)) |
2881 | return; | 2892 | return; |
@@ -3220,7 +3231,7 @@ static int tracing_open(struct inode *inode, struct file *file) | |||
3220 | iter = __tracing_open(inode, file, false); | 3231 | iter = __tracing_open(inode, file, false); |
3221 | if (IS_ERR(iter)) | 3232 | if (IS_ERR(iter)) |
3222 | ret = PTR_ERR(iter); | 3233 | ret = PTR_ERR(iter); |
3223 | else if (trace_flags & TRACE_ITER_LATENCY_FMT) | 3234 | else if (tr->trace_flags & TRACE_ITER_LATENCY_FMT) |
3224 | iter->iter_flags |= TRACE_FILE_LAT_FMT; | 3235 | iter->iter_flags |= TRACE_FILE_LAT_FMT; |
3225 | } | 3236 | } |
3226 | 3237 | ||
@@ -3467,7 +3478,7 @@ static int tracing_trace_options_show(struct seq_file *m, void *v) | |||
3467 | trace_opts = tr->current_trace->flags->opts; | 3478 | trace_opts = tr->current_trace->flags->opts; |
3468 | 3479 | ||
3469 | for (i = 0; trace_options[i]; i++) { | 3480 | for (i = 0; trace_options[i]; i++) { |
3470 | if (trace_flags & (1 << i)) | 3481 | if (tr->trace_flags & (1 << i)) |
3471 | seq_printf(m, "%s\n", trace_options[i]); | 3482 | seq_printf(m, "%s\n", trace_options[i]); |
3472 | else | 3483 | else |
3473 | seq_printf(m, "no%s\n", trace_options[i]); | 3484 | seq_printf(m, "no%s\n", trace_options[i]); |
@@ -3532,7 +3543,7 @@ int trace_keep_overwrite(struct tracer *tracer, u32 mask, int set) | |||
3532 | int set_tracer_flag(struct trace_array *tr, unsigned int mask, int enabled) | 3543 | int set_tracer_flag(struct trace_array *tr, unsigned int mask, int enabled) |
3533 | { | 3544 | { |
3534 | /* do nothing if flag is already set */ | 3545 | /* do nothing if flag is already set */ |
3535 | if (!!(trace_flags & mask) == !!enabled) | 3546 | if (!!(tr->trace_flags & mask) == !!enabled) |
3536 | return 0; | 3547 | return 0; |
3537 | 3548 | ||
3538 | /* Give the tracer a chance to approve the change */ | 3549 | /* Give the tracer a chance to approve the change */ |
@@ -3541,9 +3552,9 @@ int set_tracer_flag(struct trace_array *tr, unsigned int mask, int enabled) | |||
3541 | return -EINVAL; | 3552 | return -EINVAL; |
3542 | 3553 | ||
3543 | if (enabled) | 3554 | if (enabled) |
3544 | trace_flags |= mask; | 3555 | tr->trace_flags |= mask; |
3545 | else | 3556 | else |
3546 | trace_flags &= ~mask; | 3557 | tr->trace_flags &= ~mask; |
3547 | 3558 | ||
3548 | if (mask == TRACE_ITER_RECORD_CMD) | 3559 | if (mask == TRACE_ITER_RECORD_CMD) |
3549 | trace_event_enable_cmd_record(enabled); | 3560 | trace_event_enable_cmd_record(enabled); |
@@ -4558,7 +4569,7 @@ static int tracing_open_pipe(struct inode *inode, struct file *filp) | |||
4558 | /* trace pipe does not show start of buffer */ | 4569 | /* trace pipe does not show start of buffer */ |
4559 | cpumask_setall(iter->started); | 4570 | cpumask_setall(iter->started); |
4560 | 4571 | ||
4561 | if (trace_flags & TRACE_ITER_LATENCY_FMT) | 4572 | if (tr->trace_flags & TRACE_ITER_LATENCY_FMT) |
4562 | iter->iter_flags |= TRACE_FILE_LAT_FMT; | 4573 | iter->iter_flags |= TRACE_FILE_LAT_FMT; |
4563 | 4574 | ||
4564 | /* Output in nanoseconds only if we are using a clock in nanoseconds. */ | 4575 | /* Output in nanoseconds only if we are using a clock in nanoseconds. */ |
@@ -4615,11 +4626,13 @@ static int tracing_release_pipe(struct inode *inode, struct file *file) | |||
4615 | static unsigned int | 4626 | static unsigned int |
4616 | trace_poll(struct trace_iterator *iter, struct file *filp, poll_table *poll_table) | 4627 | trace_poll(struct trace_iterator *iter, struct file *filp, poll_table *poll_table) |
4617 | { | 4628 | { |
4629 | struct trace_array *tr = iter->tr; | ||
4630 | |||
4618 | /* Iterators are static, they should be filled or empty */ | 4631 | /* Iterators are static, they should be filled or empty */ |
4619 | if (trace_buffer_iter(iter, iter->cpu_file)) | 4632 | if (trace_buffer_iter(iter, iter->cpu_file)) |
4620 | return POLLIN | POLLRDNORM; | 4633 | return POLLIN | POLLRDNORM; |
4621 | 4634 | ||
4622 | if (trace_flags & TRACE_ITER_BLOCK) | 4635 | if (tr->trace_flags & TRACE_ITER_BLOCK) |
4623 | /* | 4636 | /* |
4624 | * Always select as readable when in blocking mode | 4637 | * Always select as readable when in blocking mode |
4625 | */ | 4638 | */ |
@@ -5036,7 +5049,7 @@ tracing_free_buffer_release(struct inode *inode, struct file *filp) | |||
5036 | struct trace_array *tr = inode->i_private; | 5049 | struct trace_array *tr = inode->i_private; |
5037 | 5050 | ||
5038 | /* disable tracing ? */ | 5051 | /* disable tracing ? */ |
5039 | if (trace_flags & TRACE_ITER_STOP_ON_FREE) | 5052 | if (tr->trace_flags & TRACE_ITER_STOP_ON_FREE) |
5040 | tracer_tracing_off(tr); | 5053 | tracer_tracing_off(tr); |
5041 | /* resize the ring buffer to 0 */ | 5054 | /* resize the ring buffer to 0 */ |
5042 | tracing_resize_ring_buffer(tr, 0, RING_BUFFER_ALL_CPUS); | 5055 | tracing_resize_ring_buffer(tr, 0, RING_BUFFER_ALL_CPUS); |
@@ -5069,7 +5082,7 @@ tracing_mark_write(struct file *filp, const char __user *ubuf, | |||
5069 | if (tracing_disabled) | 5082 | if (tracing_disabled) |
5070 | return -EINVAL; | 5083 | return -EINVAL; |
5071 | 5084 | ||
5072 | if (!(trace_flags & TRACE_ITER_MARKERS)) | 5085 | if (!(tr->trace_flags & TRACE_ITER_MARKERS)) |
5073 | return -EINVAL; | 5086 | return -EINVAL; |
5074 | 5087 | ||
5075 | if (cnt > TRACE_BUF_SIZE) | 5088 | if (cnt > TRACE_BUF_SIZE) |
@@ -6180,7 +6193,7 @@ trace_options_core_read(struct file *filp, char __user *ubuf, size_t cnt, | |||
6180 | long index = (long)filp->private_data; | 6193 | long index = (long)filp->private_data; |
6181 | char *buf; | 6194 | char *buf; |
6182 | 6195 | ||
6183 | if (trace_flags & (1 << index)) | 6196 | if (global_trace.trace_flags & (1 << index)) |
6184 | buf = "1\n"; | 6197 | buf = "1\n"; |
6185 | else | 6198 | else |
6186 | buf = "0\n"; | 6199 | buf = "0\n"; |
@@ -6407,7 +6420,7 @@ allocate_trace_buffer(struct trace_array *tr, struct trace_buffer *buf, int size | |||
6407 | { | 6420 | { |
6408 | enum ring_buffer_flags rb_flags; | 6421 | enum ring_buffer_flags rb_flags; |
6409 | 6422 | ||
6410 | rb_flags = trace_flags & TRACE_ITER_OVERWRITE ? RB_FL_OVERWRITE : 0; | 6423 | rb_flags = tr->trace_flags & TRACE_ITER_OVERWRITE ? RB_FL_OVERWRITE : 0; |
6411 | 6424 | ||
6412 | buf->tr = tr; | 6425 | buf->tr = tr; |
6413 | 6426 | ||
@@ -6502,6 +6515,8 @@ static int instance_mkdir(const char *name) | |||
6502 | if (!alloc_cpumask_var(&tr->tracing_cpumask, GFP_KERNEL)) | 6515 | if (!alloc_cpumask_var(&tr->tracing_cpumask, GFP_KERNEL)) |
6503 | goto out_free_tr; | 6516 | goto out_free_tr; |
6504 | 6517 | ||
6518 | tr->trace_flags = global_trace.trace_flags; | ||
6519 | |||
6505 | cpumask_copy(tr->tracing_cpumask, cpu_all_mask); | 6520 | cpumask_copy(tr->tracing_cpumask, cpu_all_mask); |
6506 | 6521 | ||
6507 | raw_spin_lock_init(&tr->start_lock); | 6522 | raw_spin_lock_init(&tr->start_lock); |
@@ -6938,6 +6953,7 @@ void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) | |||
6938 | /* use static because iter can be a bit big for the stack */ | 6953 | /* use static because iter can be a bit big for the stack */ |
6939 | static struct trace_iterator iter; | 6954 | static struct trace_iterator iter; |
6940 | static atomic_t dump_running; | 6955 | static atomic_t dump_running; |
6956 | struct trace_array *tr = &global_trace; | ||
6941 | unsigned int old_userobj; | 6957 | unsigned int old_userobj; |
6942 | unsigned long flags; | 6958 | unsigned long flags; |
6943 | int cnt = 0, cpu; | 6959 | int cnt = 0, cpu; |
@@ -6967,10 +6983,10 @@ void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) | |||
6967 | atomic_inc(&per_cpu_ptr(iter.trace_buffer->data, cpu)->disabled); | 6983 | atomic_inc(&per_cpu_ptr(iter.trace_buffer->data, cpu)->disabled); |
6968 | } | 6984 | } |
6969 | 6985 | ||
6970 | old_userobj = trace_flags & TRACE_ITER_SYM_USEROBJ; | 6986 | old_userobj = tr->trace_flags & TRACE_ITER_SYM_USEROBJ; |
6971 | 6987 | ||
6972 | /* don't look at user memory in panic mode */ | 6988 | /* don't look at user memory in panic mode */ |
6973 | trace_flags &= ~TRACE_ITER_SYM_USEROBJ; | 6989 | tr->trace_flags &= ~TRACE_ITER_SYM_USEROBJ; |
6974 | 6990 | ||
6975 | switch (oops_dump_mode) { | 6991 | switch (oops_dump_mode) { |
6976 | case DUMP_ALL: | 6992 | case DUMP_ALL: |
@@ -7033,7 +7049,7 @@ void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) | |||
7033 | printk(KERN_TRACE "---------------------------------\n"); | 7049 | printk(KERN_TRACE "---------------------------------\n"); |
7034 | 7050 | ||
7035 | out_enable: | 7051 | out_enable: |
7036 | trace_flags |= old_userobj; | 7052 | tr->trace_flags |= old_userobj; |
7037 | 7053 | ||
7038 | for_each_tracing_cpu(cpu) { | 7054 | for_each_tracing_cpu(cpu) { |
7039 | atomic_dec(&per_cpu_ptr(iter.trace_buffer->data, cpu)->disabled); | 7055 | atomic_dec(&per_cpu_ptr(iter.trace_buffer->data, cpu)->disabled); |
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 5219bf5f708a..eda4e6f8159b 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -217,6 +217,7 @@ struct trace_array { | |||
217 | int stop_count; | 217 | int stop_count; |
218 | int clock_id; | 218 | int clock_id; |
219 | struct tracer *current_trace; | 219 | struct tracer *current_trace; |
220 | unsigned int trace_flags; | ||
220 | unsigned int flags; | 221 | unsigned int flags; |
221 | raw_spinlock_t start_lock; | 222 | raw_spinlock_t start_lock; |
222 | struct dentry *dir; | 223 | struct dentry *dir; |
@@ -698,8 +699,6 @@ int trace_array_printk_buf(struct ring_buffer *buffer, | |||
698 | void trace_printk_seq(struct trace_seq *s); | 699 | void trace_printk_seq(struct trace_seq *s); |
699 | enum print_line_t print_trace_line(struct trace_iterator *iter); | 700 | enum print_line_t print_trace_line(struct trace_iterator *iter); |
700 | 701 | ||
701 | extern unsigned long trace_flags; | ||
702 | |||
703 | extern char trace_find_mark(unsigned long long duration); | 702 | extern char trace_find_mark(unsigned long long duration); |
704 | 703 | ||
705 | /* Standard output formatting function used for function return traces */ | 704 | /* Standard output formatting function used for function return traces */ |
@@ -994,7 +993,7 @@ extern int enable_branch_tracing(struct trace_array *tr); | |||
994 | extern void disable_branch_tracing(void); | 993 | extern void disable_branch_tracing(void); |
995 | static inline int trace_branch_enable(struct trace_array *tr) | 994 | static inline int trace_branch_enable(struct trace_array *tr) |
996 | { | 995 | { |
997 | if (trace_flags & TRACE_ITER_BRANCH) | 996 | if (tr->trace_flags & TRACE_ITER_BRANCH) |
998 | return enable_branch_tracing(tr); | 997 | return enable_branch_tracing(tr); |
999 | return 0; | 998 | return 0; |
1000 | } | 999 | } |
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index b2e3d8d80df8..0f394112a0a7 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -338,6 +338,7 @@ static int __ftrace_event_enable_disable(struct trace_event_file *file, | |||
338 | int enable, int soft_disable) | 338 | int enable, int soft_disable) |
339 | { | 339 | { |
340 | struct trace_event_call *call = file->event_call; | 340 | struct trace_event_call *call = file->event_call; |
341 | struct trace_array *tr = file->tr; | ||
341 | int ret = 0; | 342 | int ret = 0; |
342 | int disable; | 343 | int disable; |
343 | 344 | ||
@@ -401,7 +402,7 @@ static int __ftrace_event_enable_disable(struct trace_event_file *file, | |||
401 | if (soft_disable) | 402 | if (soft_disable) |
402 | set_bit(EVENT_FILE_FL_SOFT_DISABLED_BIT, &file->flags); | 403 | set_bit(EVENT_FILE_FL_SOFT_DISABLED_BIT, &file->flags); |
403 | 404 | ||
404 | if (trace_flags & TRACE_ITER_RECORD_CMD) { | 405 | if (tr->trace_flags & TRACE_ITER_RECORD_CMD) { |
405 | tracing_start_cmdline_record(); | 406 | tracing_start_cmdline_record(); |
406 | set_bit(EVENT_FILE_FL_RECORDED_CMD_BIT, &file->flags); | 407 | set_bit(EVENT_FILE_FL_RECORDED_CMD_BIT, &file->flags); |
407 | } | 408 | } |
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c index 86e45c2658e4..92382af7a213 100644 --- a/kernel/trace/trace_functions_graph.c +++ b/kernel/trace/trace_functions_graph.c | |||
@@ -112,8 +112,8 @@ enum { | |||
112 | }; | 112 | }; |
113 | 113 | ||
114 | static void | 114 | static void |
115 | print_graph_duration(unsigned long long duration, struct trace_seq *s, | 115 | print_graph_duration(struct trace_array *tr, unsigned long long duration, |
116 | u32 flags); | 116 | struct trace_seq *s, u32 flags); |
117 | 117 | ||
118 | /* Add a function return address to the trace stack on thread info.*/ | 118 | /* Add a function return address to the trace stack on thread info.*/ |
119 | int | 119 | int |
@@ -658,6 +658,7 @@ static void | |||
658 | print_graph_irq(struct trace_iterator *iter, unsigned long addr, | 658 | print_graph_irq(struct trace_iterator *iter, unsigned long addr, |
659 | enum trace_type type, int cpu, pid_t pid, u32 flags) | 659 | enum trace_type type, int cpu, pid_t pid, u32 flags) |
660 | { | 660 | { |
661 | struct trace_array *tr = iter->tr; | ||
661 | struct trace_seq *s = &iter->seq; | 662 | struct trace_seq *s = &iter->seq; |
662 | struct trace_entry *ent = iter->ent; | 663 | struct trace_entry *ent = iter->ent; |
663 | 664 | ||
@@ -665,7 +666,7 @@ print_graph_irq(struct trace_iterator *iter, unsigned long addr, | |||
665 | addr >= (unsigned long)__irqentry_text_end) | 666 | addr >= (unsigned long)__irqentry_text_end) |
666 | return; | 667 | return; |
667 | 668 | ||
668 | if (trace_flags & TRACE_ITER_CONTEXT_INFO) { | 669 | if (tr->trace_flags & TRACE_ITER_CONTEXT_INFO) { |
669 | /* Absolute time */ | 670 | /* Absolute time */ |
670 | if (flags & TRACE_GRAPH_PRINT_ABS_TIME) | 671 | if (flags & TRACE_GRAPH_PRINT_ABS_TIME) |
671 | print_graph_abs_time(iter->ts, s); | 672 | print_graph_abs_time(iter->ts, s); |
@@ -681,19 +682,19 @@ print_graph_irq(struct trace_iterator *iter, unsigned long addr, | |||
681 | } | 682 | } |
682 | 683 | ||
683 | /* Latency format */ | 684 | /* Latency format */ |
684 | if (trace_flags & TRACE_ITER_LATENCY_FMT) | 685 | if (tr->trace_flags & TRACE_ITER_LATENCY_FMT) |
685 | print_graph_lat_fmt(s, ent); | 686 | print_graph_lat_fmt(s, ent); |
686 | } | 687 | } |
687 | 688 | ||
688 | /* No overhead */ | 689 | /* No overhead */ |
689 | print_graph_duration(0, s, flags | FLAGS_FILL_START); | 690 | print_graph_duration(tr, 0, s, flags | FLAGS_FILL_START); |
690 | 691 | ||
691 | if (type == TRACE_GRAPH_ENT) | 692 | if (type == TRACE_GRAPH_ENT) |
692 | trace_seq_puts(s, "==========>"); | 693 | trace_seq_puts(s, "==========>"); |
693 | else | 694 | else |
694 | trace_seq_puts(s, "<=========="); | 695 | trace_seq_puts(s, "<=========="); |
695 | 696 | ||
696 | print_graph_duration(0, s, flags | FLAGS_FILL_END); | 697 | print_graph_duration(tr, 0, s, flags | FLAGS_FILL_END); |
697 | trace_seq_putc(s, '\n'); | 698 | trace_seq_putc(s, '\n'); |
698 | } | 699 | } |
699 | 700 | ||
@@ -731,11 +732,11 @@ trace_print_graph_duration(unsigned long long duration, struct trace_seq *s) | |||
731 | } | 732 | } |
732 | 733 | ||
733 | static void | 734 | static void |
734 | print_graph_duration(unsigned long long duration, struct trace_seq *s, | 735 | print_graph_duration(struct trace_array *tr, unsigned long long duration, |
735 | u32 flags) | 736 | struct trace_seq *s, u32 flags) |
736 | { | 737 | { |
737 | if (!(flags & TRACE_GRAPH_PRINT_DURATION) || | 738 | if (!(flags & TRACE_GRAPH_PRINT_DURATION) || |
738 | !(trace_flags & TRACE_ITER_CONTEXT_INFO)) | 739 | !(tr->trace_flags & TRACE_ITER_CONTEXT_INFO)) |
739 | return; | 740 | return; |
740 | 741 | ||
741 | /* No real adata, just filling the column with spaces */ | 742 | /* No real adata, just filling the column with spaces */ |
@@ -769,6 +770,7 @@ print_graph_entry_leaf(struct trace_iterator *iter, | |||
769 | struct trace_seq *s, u32 flags) | 770 | struct trace_seq *s, u32 flags) |
770 | { | 771 | { |
771 | struct fgraph_data *data = iter->private; | 772 | struct fgraph_data *data = iter->private; |
773 | struct trace_array *tr = iter->tr; | ||
772 | struct ftrace_graph_ret *graph_ret; | 774 | struct ftrace_graph_ret *graph_ret; |
773 | struct ftrace_graph_ent *call; | 775 | struct ftrace_graph_ent *call; |
774 | unsigned long long duration; | 776 | unsigned long long duration; |
@@ -797,7 +799,7 @@ print_graph_entry_leaf(struct trace_iterator *iter, | |||
797 | } | 799 | } |
798 | 800 | ||
799 | /* Overhead and duration */ | 801 | /* Overhead and duration */ |
800 | print_graph_duration(duration, s, flags); | 802 | print_graph_duration(tr, duration, s, flags); |
801 | 803 | ||
802 | /* Function */ | 804 | /* Function */ |
803 | for (i = 0; i < call->depth * TRACE_GRAPH_INDENT; i++) | 805 | for (i = 0; i < call->depth * TRACE_GRAPH_INDENT; i++) |
@@ -815,6 +817,7 @@ print_graph_entry_nested(struct trace_iterator *iter, | |||
815 | { | 817 | { |
816 | struct ftrace_graph_ent *call = &entry->graph_ent; | 818 | struct ftrace_graph_ent *call = &entry->graph_ent; |
817 | struct fgraph_data *data = iter->private; | 819 | struct fgraph_data *data = iter->private; |
820 | struct trace_array *tr = iter->tr; | ||
818 | int i; | 821 | int i; |
819 | 822 | ||
820 | if (data) { | 823 | if (data) { |
@@ -830,7 +833,7 @@ print_graph_entry_nested(struct trace_iterator *iter, | |||
830 | } | 833 | } |
831 | 834 | ||
832 | /* No time */ | 835 | /* No time */ |
833 | print_graph_duration(0, s, flags | FLAGS_FILL_FULL); | 836 | print_graph_duration(tr, 0, s, flags | FLAGS_FILL_FULL); |
834 | 837 | ||
835 | /* Function */ | 838 | /* Function */ |
836 | for (i = 0; i < call->depth * TRACE_GRAPH_INDENT; i++) | 839 | for (i = 0; i < call->depth * TRACE_GRAPH_INDENT; i++) |
@@ -854,6 +857,7 @@ print_graph_prologue(struct trace_iterator *iter, struct trace_seq *s, | |||
854 | { | 857 | { |
855 | struct fgraph_data *data = iter->private; | 858 | struct fgraph_data *data = iter->private; |
856 | struct trace_entry *ent = iter->ent; | 859 | struct trace_entry *ent = iter->ent; |
860 | struct trace_array *tr = iter->tr; | ||
857 | int cpu = iter->cpu; | 861 | int cpu = iter->cpu; |
858 | 862 | ||
859 | /* Pid */ | 863 | /* Pid */ |
@@ -863,7 +867,7 @@ print_graph_prologue(struct trace_iterator *iter, struct trace_seq *s, | |||
863 | /* Interrupt */ | 867 | /* Interrupt */ |
864 | print_graph_irq(iter, addr, type, cpu, ent->pid, flags); | 868 | print_graph_irq(iter, addr, type, cpu, ent->pid, flags); |
865 | 869 | ||
866 | if (!(trace_flags & TRACE_ITER_CONTEXT_INFO)) | 870 | if (!(tr->trace_flags & TRACE_ITER_CONTEXT_INFO)) |
867 | return; | 871 | return; |
868 | 872 | ||
869 | /* Absolute time */ | 873 | /* Absolute time */ |
@@ -881,7 +885,7 @@ print_graph_prologue(struct trace_iterator *iter, struct trace_seq *s, | |||
881 | } | 885 | } |
882 | 886 | ||
883 | /* Latency format */ | 887 | /* Latency format */ |
884 | if (trace_flags & TRACE_ITER_LATENCY_FMT) | 888 | if (tr->trace_flags & TRACE_ITER_LATENCY_FMT) |
885 | print_graph_lat_fmt(s, ent); | 889 | print_graph_lat_fmt(s, ent); |
886 | 890 | ||
887 | return; | 891 | return; |
@@ -1032,6 +1036,7 @@ print_graph_return(struct ftrace_graph_ret *trace, struct trace_seq *s, | |||
1032 | { | 1036 | { |
1033 | unsigned long long duration = trace->rettime - trace->calltime; | 1037 | unsigned long long duration = trace->rettime - trace->calltime; |
1034 | struct fgraph_data *data = iter->private; | 1038 | struct fgraph_data *data = iter->private; |
1039 | struct trace_array *tr = iter->tr; | ||
1035 | pid_t pid = ent->pid; | 1040 | pid_t pid = ent->pid; |
1036 | int cpu = iter->cpu; | 1041 | int cpu = iter->cpu; |
1037 | int func_match = 1; | 1042 | int func_match = 1; |
@@ -1063,7 +1068,7 @@ print_graph_return(struct ftrace_graph_ret *trace, struct trace_seq *s, | |||
1063 | print_graph_prologue(iter, s, 0, 0, flags); | 1068 | print_graph_prologue(iter, s, 0, 0, flags); |
1064 | 1069 | ||
1065 | /* Overhead and duration */ | 1070 | /* Overhead and duration */ |
1066 | print_graph_duration(duration, s, flags); | 1071 | print_graph_duration(tr, duration, s, flags); |
1067 | 1072 | ||
1068 | /* Closing brace */ | 1073 | /* Closing brace */ |
1069 | for (i = 0; i < trace->depth * TRACE_GRAPH_INDENT; i++) | 1074 | for (i = 0; i < trace->depth * TRACE_GRAPH_INDENT; i++) |
@@ -1096,7 +1101,8 @@ static enum print_line_t | |||
1096 | print_graph_comment(struct trace_seq *s, struct trace_entry *ent, | 1101 | print_graph_comment(struct trace_seq *s, struct trace_entry *ent, |
1097 | struct trace_iterator *iter, u32 flags) | 1102 | struct trace_iterator *iter, u32 flags) |
1098 | { | 1103 | { |
1099 | unsigned long sym_flags = (trace_flags & TRACE_ITER_SYM_MASK); | 1104 | struct trace_array *tr = iter->tr; |
1105 | unsigned long sym_flags = (tr->trace_flags & TRACE_ITER_SYM_MASK); | ||
1100 | struct fgraph_data *data = iter->private; | 1106 | struct fgraph_data *data = iter->private; |
1101 | struct trace_event *event; | 1107 | struct trace_event *event; |
1102 | int depth = 0; | 1108 | int depth = 0; |
@@ -1109,7 +1115,7 @@ print_graph_comment(struct trace_seq *s, struct trace_entry *ent, | |||
1109 | print_graph_prologue(iter, s, 0, 0, flags); | 1115 | print_graph_prologue(iter, s, 0, 0, flags); |
1110 | 1116 | ||
1111 | /* No time */ | 1117 | /* No time */ |
1112 | print_graph_duration(0, s, flags | FLAGS_FILL_FULL); | 1118 | print_graph_duration(tr, 0, s, flags | FLAGS_FILL_FULL); |
1113 | 1119 | ||
1114 | /* Indentation */ | 1120 | /* Indentation */ |
1115 | if (depth > 0) | 1121 | if (depth > 0) |
@@ -1250,9 +1256,10 @@ static void print_lat_header(struct seq_file *s, u32 flags) | |||
1250 | seq_printf(s, "#%.*s||| / \n", size, spaces); | 1256 | seq_printf(s, "#%.*s||| / \n", size, spaces); |
1251 | } | 1257 | } |
1252 | 1258 | ||
1253 | static void __print_graph_headers_flags(struct seq_file *s, u32 flags) | 1259 | static void __print_graph_headers_flags(struct trace_array *tr, |
1260 | struct seq_file *s, u32 flags) | ||
1254 | { | 1261 | { |
1255 | int lat = trace_flags & TRACE_ITER_LATENCY_FMT; | 1262 | int lat = tr->trace_flags & TRACE_ITER_LATENCY_FMT; |
1256 | 1263 | ||
1257 | if (lat) | 1264 | if (lat) |
1258 | print_lat_header(s, flags); | 1265 | print_lat_header(s, flags); |
@@ -1294,11 +1301,12 @@ static void print_graph_headers(struct seq_file *s) | |||
1294 | void print_graph_headers_flags(struct seq_file *s, u32 flags) | 1301 | void print_graph_headers_flags(struct seq_file *s, u32 flags) |
1295 | { | 1302 | { |
1296 | struct trace_iterator *iter = s->private; | 1303 | struct trace_iterator *iter = s->private; |
1304 | struct trace_array *tr = iter->tr; | ||
1297 | 1305 | ||
1298 | if (!(trace_flags & TRACE_ITER_CONTEXT_INFO)) | 1306 | if (!(tr->trace_flags & TRACE_ITER_CONTEXT_INFO)) |
1299 | return; | 1307 | return; |
1300 | 1308 | ||
1301 | if (trace_flags & TRACE_ITER_LATENCY_FMT) { | 1309 | if (tr->trace_flags & TRACE_ITER_LATENCY_FMT) { |
1302 | /* print nothing if the buffers are empty */ | 1310 | /* print nothing if the buffers are empty */ |
1303 | if (trace_empty(iter)) | 1311 | if (trace_empty(iter)) |
1304 | return; | 1312 | return; |
@@ -1306,7 +1314,7 @@ void print_graph_headers_flags(struct seq_file *s, u32 flags) | |||
1306 | print_trace_header(s, iter); | 1314 | print_trace_header(s, iter); |
1307 | } | 1315 | } |
1308 | 1316 | ||
1309 | __print_graph_headers_flags(s, flags); | 1317 | __print_graph_headers_flags(tr, s, flags); |
1310 | } | 1318 | } |
1311 | 1319 | ||
1312 | void graph_trace_open(struct trace_iterator *iter) | 1320 | void graph_trace_open(struct trace_iterator *iter) |
diff --git a/kernel/trace/trace_irqsoff.c b/kernel/trace/trace_irqsoff.c index c834b95cbe0b..eaf5291bcf63 100644 --- a/kernel/trace/trace_irqsoff.c +++ b/kernel/trace/trace_irqsoff.c | |||
@@ -58,13 +58,13 @@ irq_trace(void) | |||
58 | 58 | ||
59 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | 59 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
60 | static int irqsoff_display_graph(struct trace_array *tr, int set); | 60 | static int irqsoff_display_graph(struct trace_array *tr, int set); |
61 | # define is_graph() (trace_flags & TRACE_ITER_DISPLAY_GRAPH) | 61 | # define is_graph(tr) ((tr)->trace_flags & TRACE_ITER_DISPLAY_GRAPH) |
62 | #else | 62 | #else |
63 | static inline int irqsoff_display_graph(struct trace_array *tr, int set) | 63 | static inline int irqsoff_display_graph(struct trace_array *tr, int set) |
64 | { | 64 | { |
65 | return -EINVAL; | 65 | return -EINVAL; |
66 | } | 66 | } |
67 | # define is_graph() false | 67 | # define is_graph(tr) false |
68 | #endif | 68 | #endif |
69 | 69 | ||
70 | /* | 70 | /* |
@@ -149,7 +149,7 @@ static int irqsoff_display_graph(struct trace_array *tr, int set) | |||
149 | { | 149 | { |
150 | int cpu; | 150 | int cpu; |
151 | 151 | ||
152 | if (!(is_graph() ^ set)) | 152 | if (!(is_graph(tr) ^ set)) |
153 | return 0; | 153 | return 0; |
154 | 154 | ||
155 | stop_irqsoff_tracer(irqsoff_trace, !set); | 155 | stop_irqsoff_tracer(irqsoff_trace, !set); |
@@ -198,7 +198,7 @@ static void irqsoff_graph_return(struct ftrace_graph_ret *trace) | |||
198 | 198 | ||
199 | static void irqsoff_trace_open(struct trace_iterator *iter) | 199 | static void irqsoff_trace_open(struct trace_iterator *iter) |
200 | { | 200 | { |
201 | if (is_graph()) | 201 | if (is_graph(iter->tr)) |
202 | graph_trace_open(iter); | 202 | graph_trace_open(iter); |
203 | 203 | ||
204 | } | 204 | } |
@@ -220,7 +220,7 @@ static enum print_line_t irqsoff_print_line(struct trace_iterator *iter) | |||
220 | * In graph mode call the graph tracer output function, | 220 | * In graph mode call the graph tracer output function, |
221 | * otherwise go with the TRACE_FN event handler | 221 | * otherwise go with the TRACE_FN event handler |
222 | */ | 222 | */ |
223 | if (is_graph()) | 223 | if (is_graph(iter->tr)) |
224 | return print_graph_function_flags(iter, GRAPH_TRACER_FLAGS); | 224 | return print_graph_function_flags(iter, GRAPH_TRACER_FLAGS); |
225 | 225 | ||
226 | return TRACE_TYPE_UNHANDLED; | 226 | return TRACE_TYPE_UNHANDLED; |
@@ -228,7 +228,9 @@ static enum print_line_t irqsoff_print_line(struct trace_iterator *iter) | |||
228 | 228 | ||
229 | static void irqsoff_print_header(struct seq_file *s) | 229 | static void irqsoff_print_header(struct seq_file *s) |
230 | { | 230 | { |
231 | if (is_graph()) | 231 | struct trace_array *tr = irqsoff_trace; |
232 | |||
233 | if (is_graph(tr)) | ||
232 | print_graph_headers_flags(s, GRAPH_TRACER_FLAGS); | 234 | print_graph_headers_flags(s, GRAPH_TRACER_FLAGS); |
233 | else | 235 | else |
234 | trace_default_header(s); | 236 | trace_default_header(s); |
@@ -239,7 +241,7 @@ __trace_function(struct trace_array *tr, | |||
239 | unsigned long ip, unsigned long parent_ip, | 241 | unsigned long ip, unsigned long parent_ip, |
240 | unsigned long flags, int pc) | 242 | unsigned long flags, int pc) |
241 | { | 243 | { |
242 | if (is_graph()) | 244 | if (is_graph(tr)) |
243 | trace_graph_function(tr, ip, parent_ip, flags, pc); | 245 | trace_graph_function(tr, ip, parent_ip, flags, pc); |
244 | else | 246 | else |
245 | trace_function(tr, ip, parent_ip, flags, pc); | 247 | trace_function(tr, ip, parent_ip, flags, pc); |
@@ -516,7 +518,7 @@ static int register_irqsoff_function(struct trace_array *tr, int graph, int set) | |||
516 | int ret; | 518 | int ret; |
517 | 519 | ||
518 | /* 'set' is set if TRACE_ITER_FUNCTION is about to be set */ | 520 | /* 'set' is set if TRACE_ITER_FUNCTION is about to be set */ |
519 | if (function_enabled || (!set && !(trace_flags & TRACE_ITER_FUNCTION))) | 521 | if (function_enabled || (!set && !(tr->trace_flags & TRACE_ITER_FUNCTION))) |
520 | return 0; | 522 | return 0; |
521 | 523 | ||
522 | if (graph) | 524 | if (graph) |
@@ -550,9 +552,9 @@ static int irqsoff_function_set(struct trace_array *tr, u32 mask, int set) | |||
550 | return 0; | 552 | return 0; |
551 | 553 | ||
552 | if (set) | 554 | if (set) |
553 | register_irqsoff_function(tr, is_graph(), 1); | 555 | register_irqsoff_function(tr, is_graph(tr), 1); |
554 | else | 556 | else |
555 | unregister_irqsoff_function(tr, is_graph()); | 557 | unregister_irqsoff_function(tr, is_graph(tr)); |
556 | return 1; | 558 | return 1; |
557 | } | 559 | } |
558 | #else | 560 | #else |
@@ -610,7 +612,7 @@ static int __irqsoff_tracer_init(struct trace_array *tr) | |||
610 | if (irqsoff_busy) | 612 | if (irqsoff_busy) |
611 | return -EBUSY; | 613 | return -EBUSY; |
612 | 614 | ||
613 | save_flags = trace_flags; | 615 | save_flags = tr->trace_flags; |
614 | 616 | ||
615 | /* non overwrite screws up the latency tracers */ | 617 | /* non overwrite screws up the latency tracers */ |
616 | set_tracer_flag(tr, TRACE_ITER_OVERWRITE, 1); | 618 | set_tracer_flag(tr, TRACE_ITER_OVERWRITE, 1); |
@@ -626,7 +628,7 @@ static int __irqsoff_tracer_init(struct trace_array *tr) | |||
626 | 628 | ||
627 | /* Only toplevel instance supports graph tracing */ | 629 | /* Only toplevel instance supports graph tracing */ |
628 | if (start_irqsoff_tracer(tr, (tr->flags & TRACE_ARRAY_FL_GLOBAL && | 630 | if (start_irqsoff_tracer(tr, (tr->flags & TRACE_ARRAY_FL_GLOBAL && |
629 | is_graph()))) | 631 | is_graph(tr)))) |
630 | printk(KERN_ERR "failed to start irqsoff tracer\n"); | 632 | printk(KERN_ERR "failed to start irqsoff tracer\n"); |
631 | 633 | ||
632 | irqsoff_busy = true; | 634 | irqsoff_busy = true; |
@@ -638,7 +640,7 @@ static void irqsoff_tracer_reset(struct trace_array *tr) | |||
638 | int lat_flag = save_flags & TRACE_ITER_LATENCY_FMT; | 640 | int lat_flag = save_flags & TRACE_ITER_LATENCY_FMT; |
639 | int overwrite_flag = save_flags & TRACE_ITER_OVERWRITE; | 641 | int overwrite_flag = save_flags & TRACE_ITER_OVERWRITE; |
640 | 642 | ||
641 | stop_irqsoff_tracer(tr, is_graph()); | 643 | stop_irqsoff_tracer(tr, is_graph(tr)); |
642 | 644 | ||
643 | set_tracer_flag(tr, TRACE_ITER_LATENCY_FMT, lat_flag); | 645 | set_tracer_flag(tr, TRACE_ITER_LATENCY_FMT, lat_flag); |
644 | set_tracer_flag(tr, TRACE_ITER_OVERWRITE, overwrite_flag); | 646 | set_tracer_flag(tr, TRACE_ITER_OVERWRITE, overwrite_flag); |
diff --git a/kernel/trace/trace_kdb.c b/kernel/trace/trace_kdb.c index 3ccf5c2c1320..57149bce6aad 100644 --- a/kernel/trace/trace_kdb.c +++ b/kernel/trace/trace_kdb.c | |||
@@ -21,20 +21,22 @@ static void ftrace_dump_buf(int skip_lines, long cpu_file) | |||
21 | /* use static because iter can be a bit big for the stack */ | 21 | /* use static because iter can be a bit big for the stack */ |
22 | static struct trace_iterator iter; | 22 | static struct trace_iterator iter; |
23 | static struct ring_buffer_iter *buffer_iter[CONFIG_NR_CPUS]; | 23 | static struct ring_buffer_iter *buffer_iter[CONFIG_NR_CPUS]; |
24 | struct trace_array *tr; | ||
24 | unsigned int old_userobj; | 25 | unsigned int old_userobj; |
25 | int cnt = 0, cpu; | 26 | int cnt = 0, cpu; |
26 | 27 | ||
27 | trace_init_global_iter(&iter); | 28 | trace_init_global_iter(&iter); |
28 | iter.buffer_iter = buffer_iter; | 29 | iter.buffer_iter = buffer_iter; |
30 | tr = iter.tr; | ||
29 | 31 | ||
30 | for_each_tracing_cpu(cpu) { | 32 | for_each_tracing_cpu(cpu) { |
31 | atomic_inc(&per_cpu_ptr(iter.trace_buffer->data, cpu)->disabled); | 33 | atomic_inc(&per_cpu_ptr(iter.trace_buffer->data, cpu)->disabled); |
32 | } | 34 | } |
33 | 35 | ||
34 | old_userobj = trace_flags; | 36 | old_userobj = tr->trace_flags; |
35 | 37 | ||
36 | /* don't look at user memory in panic mode */ | 38 | /* don't look at user memory in panic mode */ |
37 | trace_flags &= ~TRACE_ITER_SYM_USEROBJ; | 39 | tr->trace_flags &= ~TRACE_ITER_SYM_USEROBJ; |
38 | 40 | ||
39 | kdb_printf("Dumping ftrace buffer:\n"); | 41 | kdb_printf("Dumping ftrace buffer:\n"); |
40 | 42 | ||
@@ -82,7 +84,7 @@ static void ftrace_dump_buf(int skip_lines, long cpu_file) | |||
82 | kdb_printf("---------------------------------\n"); | 84 | kdb_printf("---------------------------------\n"); |
83 | 85 | ||
84 | out: | 86 | out: |
85 | trace_flags = old_userobj; | 87 | tr->trace_flags = old_userobj; |
86 | 88 | ||
87 | for_each_tracing_cpu(cpu) { | 89 | for_each_tracing_cpu(cpu) { |
88 | atomic_dec(&per_cpu_ptr(iter.trace_buffer->data, cpu)->disabled); | 90 | atomic_dec(&per_cpu_ptr(iter.trace_buffer->data, cpu)->disabled); |
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index 3b5dcdf19dea..282982195e09 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c | |||
@@ -476,7 +476,8 @@ char trace_find_mark(unsigned long long d) | |||
476 | static int | 476 | static int |
477 | lat_print_timestamp(struct trace_iterator *iter, u64 next_ts) | 477 | lat_print_timestamp(struct trace_iterator *iter, u64 next_ts) |
478 | { | 478 | { |
479 | unsigned long verbose = trace_flags & TRACE_ITER_VERBOSE; | 479 | struct trace_array *tr = iter->tr; |
480 | unsigned long verbose = tr->trace_flags & TRACE_ITER_VERBOSE; | ||
480 | unsigned long in_ns = iter->iter_flags & TRACE_FILE_TIME_IN_NS; | 481 | unsigned long in_ns = iter->iter_flags & TRACE_FILE_TIME_IN_NS; |
481 | unsigned long long abs_ts = iter->ts - iter->trace_buffer->time_start; | 482 | unsigned long long abs_ts = iter->ts - iter->trace_buffer->time_start; |
482 | unsigned long long rel_ts = next_ts - iter->ts; | 483 | unsigned long long rel_ts = next_ts - iter->ts; |
@@ -519,6 +520,7 @@ lat_print_timestamp(struct trace_iterator *iter, u64 next_ts) | |||
519 | 520 | ||
520 | int trace_print_context(struct trace_iterator *iter) | 521 | int trace_print_context(struct trace_iterator *iter) |
521 | { | 522 | { |
523 | struct trace_array *tr = iter->tr; | ||
522 | struct trace_seq *s = &iter->seq; | 524 | struct trace_seq *s = &iter->seq; |
523 | struct trace_entry *entry = iter->ent; | 525 | struct trace_entry *entry = iter->ent; |
524 | unsigned long long t; | 526 | unsigned long long t; |
@@ -530,7 +532,7 @@ int trace_print_context(struct trace_iterator *iter) | |||
530 | trace_seq_printf(s, "%16s-%-5d [%03d] ", | 532 | trace_seq_printf(s, "%16s-%-5d [%03d] ", |
531 | comm, entry->pid, iter->cpu); | 533 | comm, entry->pid, iter->cpu); |
532 | 534 | ||
533 | if (trace_flags & TRACE_ITER_IRQ_INFO) | 535 | if (tr->trace_flags & TRACE_ITER_IRQ_INFO) |
534 | trace_print_lat_fmt(s, entry); | 536 | trace_print_lat_fmt(s, entry); |
535 | 537 | ||
536 | if (iter->iter_flags & TRACE_FILE_TIME_IN_NS) { | 538 | if (iter->iter_flags & TRACE_FILE_TIME_IN_NS) { |
@@ -546,14 +548,15 @@ int trace_print_context(struct trace_iterator *iter) | |||
546 | 548 | ||
547 | int trace_print_lat_context(struct trace_iterator *iter) | 549 | int trace_print_lat_context(struct trace_iterator *iter) |
548 | { | 550 | { |
549 | u64 next_ts; | 551 | struct trace_array *tr = iter->tr; |
550 | /* trace_find_next_entry will reset ent_size */ | 552 | /* trace_find_next_entry will reset ent_size */ |
551 | int ent_size = iter->ent_size; | 553 | int ent_size = iter->ent_size; |
552 | struct trace_seq *s = &iter->seq; | 554 | struct trace_seq *s = &iter->seq; |
555 | u64 next_ts; | ||
553 | struct trace_entry *entry = iter->ent, | 556 | struct trace_entry *entry = iter->ent, |
554 | *next_entry = trace_find_next_entry(iter, NULL, | 557 | *next_entry = trace_find_next_entry(iter, NULL, |
555 | &next_ts); | 558 | &next_ts); |
556 | unsigned long verbose = (trace_flags & TRACE_ITER_VERBOSE); | 559 | unsigned long verbose = (tr->trace_flags & TRACE_ITER_VERBOSE); |
557 | 560 | ||
558 | /* Restore the original ent_size */ | 561 | /* Restore the original ent_size */ |
559 | iter->ent_size = ent_size; | 562 | iter->ent_size = ent_size; |
@@ -1035,6 +1038,7 @@ static struct trace_event trace_stack_event = { | |||
1035 | static enum print_line_t trace_user_stack_print(struct trace_iterator *iter, | 1038 | static enum print_line_t trace_user_stack_print(struct trace_iterator *iter, |
1036 | int flags, struct trace_event *event) | 1039 | int flags, struct trace_event *event) |
1037 | { | 1040 | { |
1041 | struct trace_array *tr = iter->tr; | ||
1038 | struct userstack_entry *field; | 1042 | struct userstack_entry *field; |
1039 | struct trace_seq *s = &iter->seq; | 1043 | struct trace_seq *s = &iter->seq; |
1040 | struct mm_struct *mm = NULL; | 1044 | struct mm_struct *mm = NULL; |
@@ -1044,7 +1048,7 @@ static enum print_line_t trace_user_stack_print(struct trace_iterator *iter, | |||
1044 | 1048 | ||
1045 | trace_seq_puts(s, "<user stack trace>\n"); | 1049 | trace_seq_puts(s, "<user stack trace>\n"); |
1046 | 1050 | ||
1047 | if (trace_flags & TRACE_ITER_SYM_USEROBJ) { | 1051 | if (tr->trace_flags & TRACE_ITER_SYM_USEROBJ) { |
1048 | struct task_struct *task; | 1052 | struct task_struct *task; |
1049 | /* | 1053 | /* |
1050 | * we do the lookup on the thread group leader, | 1054 | * we do the lookup on the thread group leader, |
diff --git a/kernel/trace/trace_sched_wakeup.c b/kernel/trace/trace_sched_wakeup.c index 4a20f61274d1..4661442de07d 100644 --- a/kernel/trace/trace_sched_wakeup.c +++ b/kernel/trace/trace_sched_wakeup.c | |||
@@ -39,13 +39,13 @@ static int save_flags; | |||
39 | 39 | ||
40 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | 40 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
41 | static int wakeup_display_graph(struct trace_array *tr, int set); | 41 | static int wakeup_display_graph(struct trace_array *tr, int set); |
42 | # define is_graph() (trace_flags & TRACE_ITER_DISPLAY_GRAPH) | 42 | # define is_graph(tr) ((tr)->trace_flags & TRACE_ITER_DISPLAY_GRAPH) |
43 | #else | 43 | #else |
44 | static inline int wakeup_display_graph(struct trace_array *tr, int set) | 44 | static inline int wakeup_display_graph(struct trace_array *tr, int set) |
45 | { | 45 | { |
46 | return 0; | 46 | return 0; |
47 | } | 47 | } |
48 | # define is_graph() false | 48 | # define is_graph(tr) false |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | 51 | ||
@@ -131,7 +131,7 @@ static int register_wakeup_function(struct trace_array *tr, int graph, int set) | |||
131 | int ret; | 131 | int ret; |
132 | 132 | ||
133 | /* 'set' is set if TRACE_ITER_FUNCTION is about to be set */ | 133 | /* 'set' is set if TRACE_ITER_FUNCTION is about to be set */ |
134 | if (function_enabled || (!set && !(trace_flags & TRACE_ITER_FUNCTION))) | 134 | if (function_enabled || (!set && !(tr->trace_flags & TRACE_ITER_FUNCTION))) |
135 | return 0; | 135 | return 0; |
136 | 136 | ||
137 | if (graph) | 137 | if (graph) |
@@ -165,9 +165,9 @@ static int wakeup_function_set(struct trace_array *tr, u32 mask, int set) | |||
165 | return 0; | 165 | return 0; |
166 | 166 | ||
167 | if (set) | 167 | if (set) |
168 | register_wakeup_function(tr, is_graph(), 1); | 168 | register_wakeup_function(tr, is_graph(tr), 1); |
169 | else | 169 | else |
170 | unregister_wakeup_function(tr, is_graph()); | 170 | unregister_wakeup_function(tr, is_graph(tr)); |
171 | return 1; | 171 | return 1; |
172 | } | 172 | } |
173 | #else | 173 | #else |
@@ -221,7 +221,7 @@ static void stop_func_tracer(struct trace_array *tr, int graph) | |||
221 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | 221 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
222 | static int wakeup_display_graph(struct trace_array *tr, int set) | 222 | static int wakeup_display_graph(struct trace_array *tr, int set) |
223 | { | 223 | { |
224 | if (!(is_graph() ^ set)) | 224 | if (!(is_graph(tr) ^ set)) |
225 | return 0; | 225 | return 0; |
226 | 226 | ||
227 | stop_func_tracer(tr, !set); | 227 | stop_func_tracer(tr, !set); |
@@ -270,7 +270,7 @@ static void wakeup_graph_return(struct ftrace_graph_ret *trace) | |||
270 | 270 | ||
271 | static void wakeup_trace_open(struct trace_iterator *iter) | 271 | static void wakeup_trace_open(struct trace_iterator *iter) |
272 | { | 272 | { |
273 | if (is_graph()) | 273 | if (is_graph(iter->tr)) |
274 | graph_trace_open(iter); | 274 | graph_trace_open(iter); |
275 | } | 275 | } |
276 | 276 | ||
@@ -290,7 +290,7 @@ static enum print_line_t wakeup_print_line(struct trace_iterator *iter) | |||
290 | * In graph mode call the graph tracer output function, | 290 | * In graph mode call the graph tracer output function, |
291 | * otherwise go with the TRACE_FN event handler | 291 | * otherwise go with the TRACE_FN event handler |
292 | */ | 292 | */ |
293 | if (is_graph()) | 293 | if (is_graph(iter->tr)) |
294 | return print_graph_function_flags(iter, GRAPH_TRACER_FLAGS); | 294 | return print_graph_function_flags(iter, GRAPH_TRACER_FLAGS); |
295 | 295 | ||
296 | return TRACE_TYPE_UNHANDLED; | 296 | return TRACE_TYPE_UNHANDLED; |
@@ -298,7 +298,7 @@ static enum print_line_t wakeup_print_line(struct trace_iterator *iter) | |||
298 | 298 | ||
299 | static void wakeup_print_header(struct seq_file *s) | 299 | static void wakeup_print_header(struct seq_file *s) |
300 | { | 300 | { |
301 | if (is_graph()) | 301 | if (is_graph(wakeup_trace)) |
302 | print_graph_headers_flags(s, GRAPH_TRACER_FLAGS); | 302 | print_graph_headers_flags(s, GRAPH_TRACER_FLAGS); |
303 | else | 303 | else |
304 | trace_default_header(s); | 304 | trace_default_header(s); |
@@ -309,7 +309,7 @@ __trace_function(struct trace_array *tr, | |||
309 | unsigned long ip, unsigned long parent_ip, | 309 | unsigned long ip, unsigned long parent_ip, |
310 | unsigned long flags, int pc) | 310 | unsigned long flags, int pc) |
311 | { | 311 | { |
312 | if (is_graph()) | 312 | if (is_graph(tr)) |
313 | trace_graph_function(tr, ip, parent_ip, flags, pc); | 313 | trace_graph_function(tr, ip, parent_ip, flags, pc); |
314 | else | 314 | else |
315 | trace_function(tr, ip, parent_ip, flags, pc); | 315 | trace_function(tr, ip, parent_ip, flags, pc); |
@@ -639,7 +639,7 @@ static void start_wakeup_tracer(struct trace_array *tr) | |||
639 | */ | 639 | */ |
640 | smp_wmb(); | 640 | smp_wmb(); |
641 | 641 | ||
642 | if (start_func_tracer(tr, is_graph())) | 642 | if (start_func_tracer(tr, is_graph(tr))) |
643 | printk(KERN_ERR "failed to start wakeup tracer\n"); | 643 | printk(KERN_ERR "failed to start wakeup tracer\n"); |
644 | 644 | ||
645 | return; | 645 | return; |
@@ -652,7 +652,7 @@ fail_deprobe: | |||
652 | static void stop_wakeup_tracer(struct trace_array *tr) | 652 | static void stop_wakeup_tracer(struct trace_array *tr) |
653 | { | 653 | { |
654 | tracer_enabled = 0; | 654 | tracer_enabled = 0; |
655 | stop_func_tracer(tr, is_graph()); | 655 | stop_func_tracer(tr, is_graph(tr)); |
656 | unregister_trace_sched_switch(probe_wakeup_sched_switch, NULL); | 656 | unregister_trace_sched_switch(probe_wakeup_sched_switch, NULL); |
657 | unregister_trace_sched_wakeup_new(probe_wakeup, NULL); | 657 | unregister_trace_sched_wakeup_new(probe_wakeup, NULL); |
658 | unregister_trace_sched_wakeup(probe_wakeup, NULL); | 658 | unregister_trace_sched_wakeup(probe_wakeup, NULL); |
@@ -663,7 +663,7 @@ static bool wakeup_busy; | |||
663 | 663 | ||
664 | static int __wakeup_tracer_init(struct trace_array *tr) | 664 | static int __wakeup_tracer_init(struct trace_array *tr) |
665 | { | 665 | { |
666 | save_flags = trace_flags; | 666 | save_flags = tr->trace_flags; |
667 | 667 | ||
668 | /* non overwrite screws up the latency tracers */ | 668 | /* non overwrite screws up the latency tracers */ |
669 | set_tracer_flag(tr, TRACE_ITER_OVERWRITE, 1); | 669 | set_tracer_flag(tr, TRACE_ITER_OVERWRITE, 1); |
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c index 7d567a4b9fa7..0655afbea83f 100644 --- a/kernel/trace/trace_syscalls.c +++ b/kernel/trace/trace_syscalls.c | |||
@@ -110,6 +110,7 @@ static enum print_line_t | |||
110 | print_syscall_enter(struct trace_iterator *iter, int flags, | 110 | print_syscall_enter(struct trace_iterator *iter, int flags, |
111 | struct trace_event *event) | 111 | struct trace_event *event) |
112 | { | 112 | { |
113 | struct trace_array *tr = iter->tr; | ||
113 | struct trace_seq *s = &iter->seq; | 114 | struct trace_seq *s = &iter->seq; |
114 | struct trace_entry *ent = iter->ent; | 115 | struct trace_entry *ent = iter->ent; |
115 | struct syscall_trace_enter *trace; | 116 | struct syscall_trace_enter *trace; |
@@ -136,7 +137,7 @@ print_syscall_enter(struct trace_iterator *iter, int flags, | |||
136 | goto end; | 137 | goto end; |
137 | 138 | ||
138 | /* parameter types */ | 139 | /* parameter types */ |
139 | if (trace_flags & TRACE_ITER_VERBOSE) | 140 | if (tr->trace_flags & TRACE_ITER_VERBOSE) |
140 | trace_seq_printf(s, "%s ", entry->types[i]); | 141 | trace_seq_printf(s, "%s ", entry->types[i]); |
141 | 142 | ||
142 | /* parameter values */ | 143 | /* parameter values */ |