[RFC][PATCH 03/10] tracing: Add an 'accessor' function to ftrace_event_field

From: Tom Zanussi
Date: Fri Feb 12 2016 - 11:14:41 EST


For grabbing the contents of an event field from a trace record, it
would be useful to associate a field-specific accessor function with
an event field. This defines an accessor prototype and adds an
accessor field to struct ftrace_event_field for that purpose.

Signed-off-by: Tom Zanussi <tom.zanussi@xxxxxxxxxxxxxxx>
---
kernel/trace/trace.h | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index fed2ae0..7b48a3c 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -1030,11 +1030,16 @@ static inline void trace_branch_disable(void)
/* set ring buffers to default size if not already done so */
int tracing_update_buffers(void);

+struct ftrace_event_field;
+
+typedef u64 (*ftrace_event_field_fn_t) (struct ftrace_event_field *field, void *event);
+
struct ftrace_event_field {
struct list_head link;
const char *name;
const char *type;
int filter_type;
+ ftrace_event_field_fn_t accessor;
int offset;
int size;
int is_signed;
--
1.9.3