* [RFC PATCH 27/39] blktrace: add trace entry & pdu helpers
@ 2020-08-25 22:09 Chaitanya Kulkarni
0 siblings, 0 replies; 2+ messages in thread
From: Chaitanya Kulkarni @ 2020-08-25 22:09 UTC (permalink / raw)
To: linux-btrace
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
kernel/trace/blktrace.c | 55 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 9ddc48667105..3801809a77d5 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -1819,52 +1819,107 @@ const struct blk_io_trace *te_blk_io_trace(const struct trace_entry *ent)
return (const struct blk_io_trace *)ent;
}
+static inline
+const struct blk_io_trace_ext *te_blk_io_trace_ext(const struct trace_entry *ent)
+{
+ return (const struct blk_io_trace_ext *)ent;
+}
+
static inline const void *pdu_start(const struct trace_entry *ent, bool has_cg)
{
return (void *)(te_blk_io_trace(ent) + 1) + (has_cg ? sizeof(u64) : 0);
}
+static inline const void *pdu_start_ext(const struct trace_entry *ent, bool has_cg)
+{
+ return (void *)(te_blk_io_trace_ext(ent) + 1) +
+ (has_cg ? sizeof(u64) : 0);
+
+}
+
static inline u64 t_cgid(const struct trace_entry *ent)
{
return *(u64 *)(te_blk_io_trace(ent) + 1);
}
+static inline const void *cgid_start_ext(const struct trace_entry *ent)
+{
+ return (void *)(te_blk_io_trace_ext(ent) + 1);
+}
+
static inline int pdu_real_len(const struct trace_entry *ent, bool has_cg)
{
return te_blk_io_trace(ent)->pdu_len - (has_cg ? sizeof(u64) : 0);
}
+static inline int pdu_real_len_ext(const struct trace_entry *ent, bool has_cg)
+{
+ return te_blk_io_trace_ext(ent)->pdu_len -
+ (has_cg ? sizeof(u64) : 0);
+}
+
static inline u32 t_action(const struct trace_entry *ent)
{
return te_blk_io_trace(ent)->action;
}
+static inline u64 t_action_ext(const struct trace_entry *ent)
+{
+ return te_blk_io_trace_ext(ent)->action;
+}
+
static inline u32 t_bytes(const struct trace_entry *ent)
{
return te_blk_io_trace(ent)->bytes;
}
+static inline u32 t_bytes_ext(const struct trace_entry *ent)
+{
+ return te_blk_io_trace_ext(ent)->bytes;
+}
+
static inline u32 t_sec(const struct trace_entry *ent)
{
return te_blk_io_trace(ent)->bytes >> 9;
}
+static inline u32 t_sec_ext(const struct trace_entry *ent)
+{
+ return te_blk_io_trace_ext(ent)->bytes >> 9;
+}
+
static inline unsigned long long t_sector(const struct trace_entry *ent)
{
return te_blk_io_trace(ent)->sector;
}
+static inline unsigned long long t_sector_ext(const struct trace_entry *ent)
+{
+ return te_blk_io_trace_ext(ent)->sector;
+}
+
static inline __u16 t_error(const struct trace_entry *ent)
{
return te_blk_io_trace(ent)->error;
}
+static inline __u16 t_error_ext(const struct trace_entry *ent)
+{
+ return te_blk_io_trace_ext(ent)->error;
+}
+
static __u64 get_pdu_int(const struct trace_entry *ent, bool has_cg)
{
const __be64 *val = pdu_start(ent, has_cg);
return be64_to_cpu(*val);
}
+static __u64 get_pdu_int_ext(const struct trace_entry *ent, bool has_cg)
+{
+ const __u64 *val = pdu_start_ext(ent, has_cg);
+ return be64_to_cpu(*val);
+}
+
typedef void (blk_log_action_t) (struct trace_iterator *iter, const char *act,
bool has_cg);
--
2.22.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [RFC PATCH 27/39] blktrace: add trace entry & pdu helpers
@ 2020-11-05 2:40 Chaitanya Kulkarni
0 siblings, 0 replies; 2+ messages in thread
From: Chaitanya Kulkarni @ 2020-11-05 2:40 UTC (permalink / raw)
To: linux-btrace
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
kernel/trace/blktrace.c | 55 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 6570ba216439..f34f75666059 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -1819,52 +1819,107 @@ const struct blk_io_trace *te_blk_io_trace(const struct trace_entry *ent)
return (const struct blk_io_trace *)ent;
}
+static inline
+const struct blk_io_trace_ext *te_blk_io_trace_ext(const struct trace_entry *ent)
+{
+ return (const struct blk_io_trace_ext *)ent;
+}
+
static inline const void *pdu_start(const struct trace_entry *ent, bool has_cg)
{
return (void *)(te_blk_io_trace(ent) + 1) + (has_cg ? sizeof(u64) : 0);
}
+static inline const void *pdu_start_ext(const struct trace_entry *ent, bool has_cg)
+{
+ return (void *)(te_blk_io_trace_ext(ent) + 1) +
+ (has_cg ? sizeof(u64) : 0);
+
+}
+
static inline u64 t_cgid(const struct trace_entry *ent)
{
return *(u64 *)(te_blk_io_trace(ent) + 1);
}
+static inline const void *cgid_start_ext(const struct trace_entry *ent)
+{
+ return (void *)(te_blk_io_trace_ext(ent) + 1);
+}
+
static inline int pdu_real_len(const struct trace_entry *ent, bool has_cg)
{
return te_blk_io_trace(ent)->pdu_len - (has_cg ? sizeof(u64) : 0);
}
+static inline int pdu_real_len_ext(const struct trace_entry *ent, bool has_cg)
+{
+ return te_blk_io_trace_ext(ent)->pdu_len -
+ (has_cg ? sizeof(u64) : 0);
+}
+
static inline u32 t_action(const struct trace_entry *ent)
{
return te_blk_io_trace(ent)->action;
}
+static inline u64 t_action_ext(const struct trace_entry *ent)
+{
+ return te_blk_io_trace_ext(ent)->action;
+}
+
static inline u32 t_bytes(const struct trace_entry *ent)
{
return te_blk_io_trace(ent)->bytes;
}
+static inline u32 t_bytes_ext(const struct trace_entry *ent)
+{
+ return te_blk_io_trace_ext(ent)->bytes;
+}
+
static inline u32 t_sec(const struct trace_entry *ent)
{
return te_blk_io_trace(ent)->bytes >> 9;
}
+static inline u32 t_sec_ext(const struct trace_entry *ent)
+{
+ return te_blk_io_trace_ext(ent)->bytes >> 9;
+}
+
static inline unsigned long long t_sector(const struct trace_entry *ent)
{
return te_blk_io_trace(ent)->sector;
}
+static inline unsigned long long t_sector_ext(const struct trace_entry *ent)
+{
+ return te_blk_io_trace_ext(ent)->sector;
+}
+
static inline __u16 t_error(const struct trace_entry *ent)
{
return te_blk_io_trace(ent)->error;
}
+static inline __u16 t_error_ext(const struct trace_entry *ent)
+{
+ return te_blk_io_trace_ext(ent)->error;
+}
+
static __u64 get_pdu_int(const struct trace_entry *ent, bool has_cg)
{
const __be64 *val = pdu_start(ent, has_cg);
return be64_to_cpu(*val);
}
+static __u64 get_pdu_int_ext(const struct trace_entry *ent, bool has_cg)
+{
+ const __u64 *val = pdu_start_ext(ent, has_cg);
+ return be64_to_cpu(*val);
+}
+
typedef void (blk_log_action_t) (struct trace_iterator *iter, const char *act,
bool has_cg);
--
2.22.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-05 2:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-25 22:09 [RFC PATCH 27/39] blktrace: add trace entry & pdu helpers Chaitanya Kulkarni
2020-11-05 2:40 Chaitanya Kulkarni
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.