linux/kernel/trace
Steven Rostedt (Red Hat) 656c7f0d2d tracing: Replace kmap with copy_from_user() in trace_marker writing
Instead of using get_user_pages_fast() and kmap_atomic() when writing
to the trace_marker file, just allocate enough space on the ring buffer
directly, and write into it via copy_from_user().

Writing into the trace_marker file use to allocate a temporary buffer
to perform the copy_from_user(), as we didn't want to write into the
ring buffer if the copy failed. But as a trace_marker write is suppose
to be extremely fast, and allocating memory causes other tracepoints to
trigger, Peter Zijlstra suggested using get_user_pages_fast() and
kmap_atomic() to keep the user space pages in memory and reading it
directly. But Henrik Austad had issues with this because it required taking
the mm->mmap_sem and causing long delays with the write.

Instead, just allocate the space in the ring buffer and use
copy_from_user() directly. If it faults, return -EFAULT and write
"<faulted>" into the ring buffer.

Link: http://lkml.kernel.org/r/20161208124018.72dd0f86@gandalf.local.home

Cc: Ingo Molnar <mingo@kernel.org>
Cc: Henrik Austad <henrik@austad.us>
Cc: Peter Zijlstra <peterz@infradead.org>
Updates: d696b58ca2 "tracing: Do not allocate buffer for trace_marker"
Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2016-12-09 09:18:14 -05:00
..
Kconfig ftrace: Support full glob matching 2016-11-14 16:42:58 -05:00
Makefile Disable the __builtin_return_address() warning globally after all 2016-10-12 10:23:41 -07:00
blktrace.c block: Fix secure erase 2016-08-16 09:16:51 -06:00
bpf_trace.c bpf: add BPF_CALL_x macros for declaring helpers 2016-09-09 19:36:04 -07:00
ftrace.c ftrace: Support full glob matching 2016-11-14 16:42:58 -05:00
power-traces.c
ring_buffer.c ring-buffer: Force rb_end_commit() and rb_set_commit_to_write() inline 2016-11-23 20:42:31 -05:00
ring_buffer_benchmark.c
rpm-traces.c
trace.c tracing: Replace kmap with copy_from_user() in trace_marker writing 2016-12-09 09:18:14 -05:00
trace.h tracing: Make __buffer_unlock_commit() always_inline 2016-11-23 20:30:51 -05:00
trace_benchmark.c tracing: Allow benchmark to be enabled at early_initcall() 2016-12-09 09:16:15 -05:00
trace_benchmark.h tracing: Have the reg function allow to fail 2016-12-09 09:13:30 -05:00
trace_branch.c tracing: Make __buffer_unlock_commit() always_inline 2016-11-23 20:30:51 -05:00
trace_clock.c
trace_entries.h tracing: Add new trace_marker_raw 2016-11-15 15:13:59 -05:00
trace_event_perf.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-05-17 16:26:30 -07:00
trace_events.c tracing: Have system enable return error if one of the events fail 2016-12-09 09:15:41 -05:00
trace_events_filter.c tracing/filter: Define op as the enum that it is 2016-11-14 16:42:59 -05:00
trace_events_filter_test.h
trace_events_hist.c tracing: Fix use-after-free in hist_register_trigger() 2016-08-02 15:16:30 -04:00
trace_events_trigger.c tracing: Call traceoff trigger after event is recorded 2016-09-23 09:47:59 -04:00
trace_export.c
trace_functions.c ftrace: Have set_ftrace_pid use the bitmap like events do 2016-06-20 09:54:19 -04:00
trace_functions_graph.c tracing: Make __buffer_unlock_commit() always_inline 2016-11-23 20:30:51 -05:00
trace_hwlat.c tracing: Make __buffer_unlock_commit() always_inline 2016-11-23 20:30:51 -05:00
trace_irqsoff.c
trace_kdb.c
trace_kprobe.c ftrace: kprobe: uprobe: Add x8/x16/x32/x64 for hexadecimal types 2016-08-23 15:38:09 -03:00
trace_mmiotrace.c tracing: Expose CPU physical addresses (resource values) for PCI devices 2016-06-20 09:54:22 -04:00
trace_nop.c
trace_output.c tracing: Add new trace_marker_raw 2016-11-15 15:13:59 -05:00
trace_output.h
trace_printk.c tracing: Handle NULL formats in hold_module_trace_bprintk_format() 2016-06-20 09:46:12 -04:00
trace_probe.c ftrace: kprobe: uprobe: Show u8/u16/u32/u64 types in decimal 2016-08-23 17:06:38 -03:00
trace_probe.h ftrace: kprobe: uprobe: Show u8/u16/u32/u64 types in decimal 2016-08-23 17:06:38 -03:00
trace_sched_switch.c
trace_sched_wakeup.c tracing: Allow wakeup_dl tracer to be used by instances 2016-11-14 16:43:00 -05:00
trace_selftest.c
trace_selftest_dynamic.c
trace_seq.c
trace_stack.c
trace_stat.c
trace_stat.h
trace_syscalls.c tracing/syscalls: fix multiline in error message text 2016-09-29 10:25:23 +02:00
trace_uprobe.c This release cycle is rather small. Just a few fixes to tracing. 2016-10-06 11:48:41 -07:00
tracing_map.c
tracing_map.h