2022-10-18 12:06:48

by sunliming

[permalink] [raw]
Subject: [PATCH 5/5] ring-buffer: Delete interface for setting absolute time stamps

Commit efe6196a6bc5 ("ring-buffer: Allow ring_buffer_event_time_stamp() to
return time stamp of all events") make ring_buffer_event_time_stamp() have
the ability to return time stamp of all events. And there is no user about
this interface. So remove it.

Signed-off-by: sunliming <[email protected]>
---
include/linux/ring_buffer.h | 2 --
kernel/trace/ring_buffer.c | 11 -----------
2 files changed, 13 deletions(-)

diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h
index 2504df9a0453..b7bcf2ee0945 100644
--- a/include/linux/ring_buffer.h
+++ b/include/linux/ring_buffer.h
@@ -186,8 +186,6 @@ void ring_buffer_normalize_time_stamp(struct trace_buffer *buffer,
int cpu, u64 *ts);
void ring_buffer_set_clock(struct trace_buffer *buffer,
u64 (*clock)(void));
-void ring_buffer_set_time_stamp_abs(struct trace_buffer *buffer, bool abs);
-bool ring_buffer_time_stamp_abs(struct trace_buffer *buffer);

size_t ring_buffer_nr_pages(struct trace_buffer *buffer, int cpu);
size_t ring_buffer_nr_dirty_pages(struct trace_buffer *buffer, int cpu);
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index cb261456216f..68947652e46d 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -551,7 +551,6 @@ struct trace_buffer {
u64 (*clock)(void);

struct rb_irq_work irq_work;
- bool time_stamp_abs;
};

struct ring_buffer_iter {
@@ -1876,16 +1875,6 @@ void ring_buffer_set_clock(struct trace_buffer *buffer,
buffer->clock = clock;
}

-void ring_buffer_set_time_stamp_abs(struct trace_buffer *buffer, bool abs)
-{
- buffer->time_stamp_abs = abs;
-}
-
-bool ring_buffer_time_stamp_abs(struct trace_buffer *buffer)
-{
- return buffer->time_stamp_abs;
-}
-
static void rb_reset_cpu(struct ring_buffer_per_cpu *cpu_buffer);

static inline unsigned long rb_page_entries(struct buffer_page *bpage)
--
2.25.1