struct lttng_type type;
};
-struct lttng_event_desc {
+struct lttng_event_ctx {
const struct lttng_event_field *fields;
+ unsigned int nr_fields;
+};
+
+struct lttng_event_desc {
const char *name;
void *probe_callback;
+ const struct lttng_event_ctx *ctx; /* context */
+ const struct lttng_event_field *fields; /* event payload */
unsigned int nr_fields;
};
desc->nr_fields = 2;
desc->fields = fields =
kzalloc(2 * sizeof(struct lttng_event_field), GFP_KERNEL);
+ if (!desc->fields) {
+ ret = -ENOMEM;
+ goto error_fields;
+ }
fields[0].name = "ip";
fields[0].type.atype = atype_integer;
fields[0].type.u.basic.integer.size = sizeof(unsigned long);
return 0;
+error_fields:
+ kfree(desc->name);
error_str:
kfree(desc);
return ret;
wrapper_unregister_ftrace_function_probe(event->u.ftrace.symbol_name,
<tng_ftrace_ops, event);
kfree(event->u.ftrace.symbol_name);
+ kfree(desc->fields);
kfree(event->desc->name);
kfree(event->desc);
}
desc->nr_fields = 1;
desc->fields = field =
kzalloc(1 * sizeof(struct lttng_event_field), GFP_KERNEL);
+ if (!field) {
+ ret = -ENOMEM;
+ goto error_field;
+ }
field->name = "ip";
field->type.atype = atype_integer;
field->type.u.basic.integer.size = sizeof(unsigned long);
return 0;
+error_field:
+ kfree(desc->name);
error_str:
kfree(desc);
return ret;
register_error:
kfree(event->u.kprobe.symbol_name);
name_error:
+ kfree(event->desc->fields);
kfree(event->desc->name);
kfree(event->desc);
error:
{
unregister_kprobe(&event->u.kprobe.kp);
kfree(event->u.kprobe.symbol_name);
+ kfree(event->desc->fields);
kfree(event->desc->name);
kfree(event->desc);
}