.. | .. |
---|
371 | 371 | { |
---|
372 | 372 | struct trace_event_call *call = file->event_call; |
---|
373 | 373 | struct trace_array *tr = file->tr; |
---|
374 | | - unsigned long file_flags = file->flags; |
---|
375 | 374 | int ret = 0; |
---|
376 | 375 | int disable; |
---|
377 | 376 | |
---|
.. | .. |
---|
395 | 394 | break; |
---|
396 | 395 | disable = file->flags & EVENT_FILE_FL_SOFT_DISABLED; |
---|
397 | 396 | clear_bit(EVENT_FILE_FL_SOFT_MODE_BIT, &file->flags); |
---|
| 397 | + /* Disable use of trace_buffered_event */ |
---|
| 398 | + trace_buffered_event_disable(); |
---|
398 | 399 | } else |
---|
399 | 400 | disable = !(file->flags & EVENT_FILE_FL_SOFT_MODE); |
---|
400 | 401 | |
---|
.. | .. |
---|
433 | 434 | if (atomic_inc_return(&file->sm_ref) > 1) |
---|
434 | 435 | break; |
---|
435 | 436 | set_bit(EVENT_FILE_FL_SOFT_MODE_BIT, &file->flags); |
---|
| 437 | + /* Enable use of trace_buffered_event */ |
---|
| 438 | + trace_buffered_event_enable(); |
---|
436 | 439 | } |
---|
437 | 440 | |
---|
438 | 441 | if (!(file->flags & EVENT_FILE_FL_ENABLED)) { |
---|
.. | .. |
---|
470 | 473 | set_bit(EVENT_FILE_FL_WAS_ENABLED_BIT, &file->flags); |
---|
471 | 474 | } |
---|
472 | 475 | break; |
---|
473 | | - } |
---|
474 | | - |
---|
475 | | - /* Enable or disable use of trace_buffered_event */ |
---|
476 | | - if ((file_flags & EVENT_FILE_FL_SOFT_DISABLED) != |
---|
477 | | - (file->flags & EVENT_FILE_FL_SOFT_DISABLED)) { |
---|
478 | | - if (file->flags & EVENT_FILE_FL_SOFT_DISABLED) |
---|
479 | | - trace_buffered_event_enable(); |
---|
480 | | - else |
---|
481 | | - trace_buffered_event_disable(); |
---|
482 | 476 | } |
---|
483 | 477 | |
---|
484 | 478 | return ret; |
---|
.. | .. |
---|
1861 | 1855 | }; |
---|
1862 | 1856 | |
---|
1863 | 1857 | static const struct file_operations ftrace_enable_fops = { |
---|
1864 | | - .open = tracing_open_generic, |
---|
| 1858 | + .open = tracing_open_file_tr, |
---|
1865 | 1859 | .read = event_enable_read, |
---|
1866 | 1860 | .write = event_enable_write, |
---|
| 1861 | + .release = tracing_release_file_tr, |
---|
1867 | 1862 | .llseek = default_llseek, |
---|
1868 | 1863 | }; |
---|
1869 | 1864 | |
---|
.. | .. |
---|
1880 | 1875 | }; |
---|
1881 | 1876 | |
---|
1882 | 1877 | static const struct file_operations ftrace_event_filter_fops = { |
---|
1883 | | - .open = tracing_open_generic, |
---|
| 1878 | + .open = tracing_open_file_tr, |
---|
1884 | 1879 | .read = event_filter_read, |
---|
1885 | 1880 | .write = event_filter_write, |
---|
| 1881 | + .release = tracing_release_file_tr, |
---|
1886 | 1882 | .llseek = default_llseek, |
---|
1887 | 1883 | }; |
---|
1888 | 1884 | |
---|
.. | .. |
---|
2661 | 2657 | * over from this module may be passed to the new module events and |
---|
2662 | 2658 | * unexpected results may occur. |
---|
2663 | 2659 | */ |
---|
2664 | | - tracing_reset_all_online_cpus(); |
---|
| 2660 | + tracing_reset_all_online_cpus_unlocked(); |
---|
2665 | 2661 | } |
---|
2666 | 2662 | |
---|
2667 | 2663 | static int trace_module_notify(struct notifier_block *self, |
---|