aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/ring_buffer.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-10 22:58:13 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-10 22:58:13 -0500
commit1dd7dcb6eaa677b034e7ef63df8320277507ae70 (patch)
tree3f1592b634d7bdde94e00570925be2dade8433d4 /kernel/trace/ring_buffer.c
parentb6da0076bab5a12afb19312ffee41c95490af2a0 (diff)
parent3558a5ac50dbb2419cc649d5e154af161d661037 (diff)
Merge tag 'trace-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing updates from Steven Rostedt: "There was a lot of clean ups and minor fixes. One of those clean ups was to the trace_seq code. It also removed the return values to the trace_seq_*() functions and use trace_seq_has_overflowed() to see if the buffer filled up or not. This is similar to work being done to the seq_file code as well in another tree. Some of the other goodies include: - Added some "!" (NOT) logic to the tracing filter. - Fixed the frame pointer logic to the x86_64 mcount trampolines - Added the logic for dynamic trampolines on !CONFIG_PREEMPT systems. That is, the ftrace trampoline can be dynamically allocated and be called directly by functions that only have a single hook to them" * tag 'trace-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (55 commits) tracing: Truncated output is better than nothing tracing: Add additional marks to signal very large time deltas Documentation: describe trace_buf_size parameter more accurately tracing: Allow NOT to filter AND and OR clauses tracing: Add NOT to filtering logic ftrace/fgraph/x86: Have prepare_ftrace_return() take ip as first parameter ftrace/x86: Get rid of ftrace_caller_setup ftrace/x86: Have save_mcount_regs macro also save stack frames if needed ftrace/x86: Add macro MCOUNT_REG_SIZE for amount of stack used to save mcount regs ftrace/x86: Simplify save_mcount_regs on getting RIP ftrace/x86: Have save_mcount_regs store RIP in %rdi for first parameter ftrace/x86: Rename MCOUNT_SAVE_FRAME and add more detailed comments ftrace/x86: Move MCOUNT_SAVE_FRAME out of header file ftrace/x86: Have static tracing also use ftrace_caller_setup ftrace/x86: Have static function tracing always test for function graph kprobes: Add IPMODIFY flag to kprobe_ftrace_ops ftrace, kprobes: Support IPMODIFY flag to find IP modify conflict kprobes/ftrace: Recover original IP if pre_handler doesn't change it tracing/trivial: Fix typos and make an int into a bool tracing: Deletion of an unnecessary check before iput() ...
Diffstat (limited to 'kernel/trace/ring_buffer.c')
-rw-r--r--kernel/trace/ring_buffer.c75
1 files changed, 36 insertions, 39 deletions
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index a56e07c8d15b..7a4104cb95cb 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -34,21 +34,19 @@ static void update_pages_handler(struct work_struct *work);
34 */ 34 */
35int ring_buffer_print_entry_header(struct trace_seq *s) 35int ring_buffer_print_entry_header(struct trace_seq *s)
36{ 36{
37 int ret; 37 trace_seq_puts(s, "# compressed entry header\n");
38 38 trace_seq_puts(s, "\ttype_len : 5 bits\n");
39 ret = trace_seq_puts(s, "# compressed entry header\n"); 39 trace_seq_puts(s, "\ttime_delta : 27 bits\n");
40 ret = trace_seq_puts(s, "\ttype_len : 5 bits\n"); 40 trace_seq_puts(s, "\tarray : 32 bits\n");
41 ret = trace_seq_puts(s, "\ttime_delta : 27 bits\n"); 41 trace_seq_putc(s, '\n');
42 ret = trace_seq_puts(s, "\tarray : 32 bits\n"); 42 trace_seq_printf(s, "\tpadding : type == %d\n",
43 ret = trace_seq_putc(s, '\n'); 43 RINGBUF_TYPE_PADDING);
44 ret = trace_seq_printf(s, "\tpadding : type == %d\n", 44 trace_seq_printf(s, "\ttime_extend : type == %d\n",
45 RINGBUF_TYPE_PADDING); 45 RINGBUF_TYPE_TIME_EXTEND);
46 ret = trace_seq_printf(s, "\ttime_extend : type == %d\n", 46 trace_seq_printf(s, "\tdata max type_len == %d\n",
47 RINGBUF_TYPE_TIME_EXTEND); 47 RINGBUF_TYPE_DATA_TYPE_LEN_MAX);
48 ret = trace_seq_printf(s, "\tdata max type_len == %d\n",
49 RINGBUF_TYPE_DATA_TYPE_LEN_MAX);
50 48
51 return ret; 49 return !trace_seq_has_overflowed(s);
52} 50}
53 51
54/* 52/*
@@ -419,32 +417,31 @@ static inline int test_time_stamp(u64 delta)
419int ring_buffer_print_page_header(struct trace_seq *s) 417int ring_buffer_print_page_header(struct trace_seq *s)
420{ 418{
421 struct buffer_data_page field; 419 struct buffer_data_page field;
422 int ret;
423
424 ret = trace_seq_printf(s, "\tfield: u64 timestamp;\t"
425 "offset:0;\tsize:%u;\tsigned:%u;\n",
426 (unsigned int)sizeof(field.time_stamp),
427 (unsigned int)is_signed_type(u64));
428
429 ret = trace_seq_printf(s, "\tfield: local_t commit;\t"
430 "offset:%u;\tsize:%u;\tsigned:%u;\n",
431 (unsigned int)offsetof(typeof(field), commit),
432 (unsigned int)sizeof(field.commit),
433 (unsigned int)is_signed_type(long));
434
435 ret = trace_seq_printf(s, "\tfield: int overwrite;\t"
436 "offset:%u;\tsize:%u;\tsigned:%u;\n",
437 (unsigned int)offsetof(typeof(field), commit),
438 1,
439 (unsigned int)is_signed_type(long));
440
441 ret = trace_seq_printf(s, "\tfield: char data;\t"
442 "offset:%u;\tsize:%u;\tsigned:%u;\n",
443 (unsigned int)offsetof(typeof(field), data),
444 (unsigned int)BUF_PAGE_SIZE,
445 (unsigned int)is_signed_type(char));
446 420
447 return ret; 421 trace_seq_printf(s, "\tfield: u64 timestamp;\t"
422 "offset:0;\tsize:%u;\tsigned:%u;\n",
423 (unsigned int)sizeof(field.time_stamp),
424 (unsigned int)is_signed_type(u64));
425
426 trace_seq_printf(s, "\tfield: local_t commit;\t"
427 "offset:%u;\tsize:%u;\tsigned:%u;\n",
428 (unsigned int)offsetof(typeof(field), commit),
429 (unsigned int)sizeof(field.commit),
430 (unsigned int)is_signed_type(long));
431
432 trace_seq_printf(s, "\tfield: int overwrite;\t"
433 "offset:%u;\tsize:%u;\tsigned:%u;\n",
434 (unsigned int)offsetof(typeof(field), commit),
435 1,
436 (unsigned int)is_signed_type(long));
437
438 trace_seq_printf(s, "\tfield: char data;\t"
439 "offset:%u;\tsize:%u;\tsigned:%u;\n",
440 (unsigned int)offsetof(typeof(field), data),
441 (unsigned int)BUF_PAGE_SIZE,
442 (unsigned int)is_signed_type(char));
443
444 return !trace_seq_has_overflowed(s);
448} 445}
449 446
450struct rb_irq_work { 447struct rb_irq_work {