diff options
Diffstat (limited to 'kernel/trace/trace_mmiotrace.c')
-rw-r--r-- | kernel/trace/trace_mmiotrace.c | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/kernel/trace/trace_mmiotrace.c b/kernel/trace/trace_mmiotrace.c index e62cbf78eab6..fffcb069f1dc 100644 --- a/kernel/trace/trace_mmiotrace.c +++ b/kernel/trace/trace_mmiotrace.c | |||
@@ -22,44 +22,35 @@ static unsigned long prev_overruns; | |||
22 | 22 | ||
23 | static void mmio_reset_data(struct trace_array *tr) | 23 | static void mmio_reset_data(struct trace_array *tr) |
24 | { | 24 | { |
25 | int cpu; | ||
26 | |||
27 | overrun_detected = false; | 25 | overrun_detected = false; |
28 | prev_overruns = 0; | 26 | prev_overruns = 0; |
29 | tr->time_start = ftrace_now(tr->cpu); | ||
30 | 27 | ||
31 | for_each_online_cpu(cpu) | 28 | tracing_reset_online_cpus(tr); |
32 | tracing_reset(tr, cpu); | ||
33 | } | 29 | } |
34 | 30 | ||
35 | static void mmio_trace_init(struct trace_array *tr) | 31 | static int mmio_trace_init(struct trace_array *tr) |
36 | { | 32 | { |
37 | pr_debug("in %s\n", __func__); | 33 | pr_debug("in %s\n", __func__); |
38 | mmio_trace_array = tr; | 34 | mmio_trace_array = tr; |
39 | if (tr->ctrl) { | 35 | |
40 | mmio_reset_data(tr); | 36 | mmio_reset_data(tr); |
41 | enable_mmiotrace(); | 37 | enable_mmiotrace(); |
42 | } | 38 | return 0; |
43 | } | 39 | } |
44 | 40 | ||
45 | static void mmio_trace_reset(struct trace_array *tr) | 41 | static void mmio_trace_reset(struct trace_array *tr) |
46 | { | 42 | { |
47 | pr_debug("in %s\n", __func__); | 43 | pr_debug("in %s\n", __func__); |
48 | if (tr->ctrl) | 44 | |
49 | disable_mmiotrace(); | 45 | disable_mmiotrace(); |
50 | mmio_reset_data(tr); | 46 | mmio_reset_data(tr); |
51 | mmio_trace_array = NULL; | 47 | mmio_trace_array = NULL; |
52 | } | 48 | } |
53 | 49 | ||
54 | static void mmio_trace_ctrl_update(struct trace_array *tr) | 50 | static void mmio_trace_start(struct trace_array *tr) |
55 | { | 51 | { |
56 | pr_debug("in %s\n", __func__); | 52 | pr_debug("in %s\n", __func__); |
57 | if (tr->ctrl) { | 53 | mmio_reset_data(tr); |
58 | mmio_reset_data(tr); | ||
59 | enable_mmiotrace(); | ||
60 | } else { | ||
61 | disable_mmiotrace(); | ||
62 | } | ||
63 | } | 54 | } |
64 | 55 | ||
65 | static int mmio_print_pcidev(struct trace_seq *s, const struct pci_dev *dev) | 56 | static int mmio_print_pcidev(struct trace_seq *s, const struct pci_dev *dev) |
@@ -296,10 +287,10 @@ static struct tracer mmio_tracer __read_mostly = | |||
296 | .name = "mmiotrace", | 287 | .name = "mmiotrace", |
297 | .init = mmio_trace_init, | 288 | .init = mmio_trace_init, |
298 | .reset = mmio_trace_reset, | 289 | .reset = mmio_trace_reset, |
290 | .start = mmio_trace_start, | ||
299 | .pipe_open = mmio_pipe_open, | 291 | .pipe_open = mmio_pipe_open, |
300 | .close = mmio_close, | 292 | .close = mmio_close, |
301 | .read = mmio_read, | 293 | .read = mmio_read, |
302 | .ctrl_update = mmio_trace_ctrl_update, | ||
303 | .print_line = mmio_print_line, | 294 | .print_line = mmio_print_line, |
304 | }; | 295 | }; |
305 | 296 | ||
@@ -371,5 +362,5 @@ void mmio_trace_mapping(struct mmiotrace_map *map) | |||
371 | 362 | ||
372 | int mmio_trace_printk(const char *fmt, va_list args) | 363 | int mmio_trace_printk(const char *fmt, va_list args) |
373 | { | 364 | { |
374 | return trace_vprintk(0, fmt, args); | 365 | return trace_vprintk(0, -1, fmt, args); |
375 | } | 366 | } |