* [RFC PATCH 31/38] blktrace: add trace_synthesize helper
@ 2021-01-26 23:33 Chaitanya Kulkarni
0 siblings, 0 replies; only message in thread
From: Chaitanya Kulkarni @ 2021-01-26 23:33 UTC (permalink / raw)
To: linux-btrace
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
kernel/trace/blktrace.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index e9a1e221e011..d5045ddc2a07 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -2420,6 +2420,21 @@ static void blk_trace_synthesize_old_trace(struct trace_iterator *iter)
sizeof(old) - offset + t->pdu_len);
}
+static void blk_trace_synthesize_old_trace_ext(struct trace_iterator *iter)
+{
+ struct trace_seq *s = &iter->seq;
+ struct blk_io_trace_ext *t = (struct blk_io_trace_ext *)iter->ent;
+ const int offset = offsetof(struct blk_io_trace_ext, sector);
+ struct blk_io_trace_ext old = {
+ .magic = BLK_IO_TRACE_MAGIC | BLK_IO_TRACE_VERSION_EXT,
+ .time = iter->ts,
+ };
+
+ trace_seq_putmem(s, &old, offset);
+ trace_seq_putmem(s, &t->sector,
+ sizeof(old) - offset + t->pdu_len);
+}
+
static enum print_line_t
blk_trace_event_print_binary(struct trace_iterator *iter, int flags,
struct trace_event *event)
--
2.22.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-01-26 23:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-26 23:33 [RFC PATCH 31/38] blktrace: add trace_synthesize helper Chaitanya Kulkarni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).