@@ -60,7 +60,7 @@ static struct json_object *num_to_json(void *num, int elem_size, unsigned long f
}
static int cxl_event_to_json(struct tep_event *event, struct tep_record *record,
- struct list_head *jlist_head)
+ struct event_ctx *ctx)
{
struct json_object *jevent, *jobj, *jarray;
struct tep_format_field **fields;
@@ -190,7 +190,7 @@ static int cxl_event_to_json(struct tep_event *event, struct tep_record *record,
}
}
- list_add_tail(jlist_head, &jnode->list);
+ list_add_tail(&ctx->jlist_head, &jnode->list);
return 0;
err_jevent:
@@ -220,10 +220,9 @@ static int cxl_event_parse(struct tep_event *event, struct tep_record *record,
}
if (event_ctx->parse_event)
- return event_ctx->parse_event(event, record,
- &event_ctx->jlist_head);
+ return event_ctx->parse_event(event, record, event_ctx);
- return cxl_event_to_json(event, record, &event_ctx->jlist_head);
+ return cxl_event_to_json(event, record, event_ctx);
}
int cxl_parse_events(struct tracefs_instance *inst, struct event_ctx *ectx)
@@ -11,13 +11,21 @@ struct jlist_node {
struct list_node list;
};
+struct poison_ctx {
+ struct json_object *jpoison;
+ struct cxl_region *region;
+ struct cxl_memdev *memdev;
+ unsigned long flags;
+};
+
struct event_ctx {
const char *system;
struct list_head jlist_head;
const char *event_name; /* optional */
int event_pid; /* optional */
+ struct poison_ctx *poison_ctx; /* optional */
int (*parse_event)(struct tep_event *event, struct tep_record *record,
- struct list_head *jlist_head); /* optional */
+ struct event_ctx *ctx);
};
int cxl_parse_events(struct tracefs_instance *inst, struct event_ctx *ectx);