Add PID context
[lttng-modules.git] / probes / lttng-ftrace.c
index 5b4cf2e7e153c0318e2ca8d485489bd46340e7aa..c18a4702c90be4d8df6ef06490b2445385ed7e4d 100644 (file)
@@ -78,7 +78,7 @@ int lttng_create_ftrace_event(const char *name, struct ltt_event *event)
        fields[0].type.atype = atype_integer;
        fields[0].type.u.basic.integer.size = sizeof(unsigned long) * CHAR_BIT;
        fields[0].type.u.basic.integer.alignment = ltt_alignof(unsigned long) * CHAR_BIT;
-       fields[0].type.u.basic.integer.signedness = 0;
+       fields[0].type.u.basic.integer.signedness = is_signed_type(unsigned long);
        fields[0].type.u.basic.integer.reverse_byte_order = 0;
        fields[0].type.u.basic.integer.base = 16;
        fields[0].type.u.basic.integer.encoding = lttng_encode_none;
@@ -87,11 +87,12 @@ int lttng_create_ftrace_event(const char *name, struct ltt_event *event)
        fields[1].type.atype = atype_integer;
        fields[1].type.u.basic.integer.size = sizeof(unsigned long) * CHAR_BIT;
        fields[1].type.u.basic.integer.alignment = ltt_alignof(unsigned long) * CHAR_BIT;
-       fields[1].type.u.basic.integer.signedness = 0;
+       fields[1].type.u.basic.integer.signedness = is_signed_type(unsigned long);
        fields[1].type.u.basic.integer.reverse_byte_order = 0;
        fields[1].type.u.basic.integer.base = 16;
        fields[1].type.u.basic.integer.encoding = lttng_encode_none;
 
+       desc->owner = THIS_MODULE;
        event->desc = desc;
 
        return 0;
@@ -145,12 +146,17 @@ void lttng_ftrace_unregister(struct ltt_event *event)
 {
        wrapper_unregister_ftrace_function_probe(event->u.ftrace.symbol_name,
                        &lttng_ftrace_ops, event);
+}
+EXPORT_SYMBOL_GPL(lttng_ftrace_unregister);
+
+void lttng_ftrace_destroy_private(struct ltt_event *event)
+{
        kfree(event->u.ftrace.symbol_name);
        kfree(event->desc->fields);
        kfree(event->desc->name);
        kfree(event->desc);
 }
-EXPORT_SYMBOL_GPL(lttng_ftrace_unregister);
+EXPORT_SYMBOL_GPL(lttng_ftrace_destroy_private);
 
 int lttng_ftrace_init(void)
 {
This page took 0.024118 seconds and 4 git commands to generate.