diff options
author | Tom Zanussi <tom.zanussi@linux.intel.com> | 2018-01-15 21:51:39 -0500 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2018-03-10 16:05:50 -0500 |
commit | 00b4145298aeb05a2d110117ed18148cb21ebd14 (patch) | |
tree | 610810c0d71a584fe63b555d07dafba619ab8054 /kernel/trace/ring_buffer.c | |
parent | c193707dde77ace92a649cd59a17e105e2fbeaef (diff) |
ring-buffer: Add interface for setting absolute time stamps
Define a new function, tracing_set_time_stamp_abs(), which can be used
to enable or disable the use of absolute timestamps rather than time
deltas for a trace array.
Only the interface is added here; a subsequent patch will add the
underlying implementation.
Link: http://lkml.kernel.org/r/ce96119de44c7fe0ee44786d15254e9b493040d3.1516069914.git.tom.zanussi@linux.intel.com
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/ring_buffer.c')
-rw-r--r-- | kernel/trace/ring_buffer.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index dcf1c4dd3efe..2a03e069bbc6 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c | |||
@@ -488,6 +488,7 @@ struct ring_buffer { | |||
488 | u64 (*clock)(void); | 488 | u64 (*clock)(void); |
489 | 489 | ||
490 | struct rb_irq_work irq_work; | 490 | struct rb_irq_work irq_work; |
491 | bool time_stamp_abs; | ||
491 | }; | 492 | }; |
492 | 493 | ||
493 | struct ring_buffer_iter { | 494 | struct ring_buffer_iter { |
@@ -1382,6 +1383,16 @@ void ring_buffer_set_clock(struct ring_buffer *buffer, | |||
1382 | buffer->clock = clock; | 1383 | buffer->clock = clock; |
1383 | } | 1384 | } |
1384 | 1385 | ||
1386 | void ring_buffer_set_time_stamp_abs(struct ring_buffer *buffer, bool abs) | ||
1387 | { | ||
1388 | buffer->time_stamp_abs = abs; | ||
1389 | } | ||
1390 | |||
1391 | bool ring_buffer_time_stamp_abs(struct ring_buffer *buffer) | ||
1392 | { | ||
1393 | return buffer->time_stamp_abs; | ||
1394 | } | ||
1395 | |||
1385 | static void rb_reset_cpu(struct ring_buffer_per_cpu *cpu_buffer); | 1396 | static void rb_reset_cpu(struct ring_buffer_per_cpu *cpu_buffer); |
1386 | 1397 | ||
1387 | static inline unsigned long rb_page_entries(struct buffer_page *bpage) | 1398 | static inline unsigned long rb_page_entries(struct buffer_page *bpage) |