Take care of units in description for ftrace and kprobes
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 21 May 2011 00:59:00 +0000 (20:59 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 21 May 2011 00:59:00 +0000 (20:59 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
ltt-events.h
probes/lttng-ftrace.c
probes/lttng-kprobes.c

index 45d459d47f39af0187763a38d75e5283652f1987..6bdacf6ec76d8ba8050fd4374213585323a9cc45 100644 (file)
@@ -17,6 +17,7 @@
 struct ltt_channel;
 struct ltt_session;
 struct lib_ring_buffer_ctx;
+struct perf_event;
 
 /* Type description */
 
@@ -112,9 +113,22 @@ struct lttng_event_field {
        struct lttng_type type;
 };
 
-struct lttng_event_ctx {
-       const struct lttng_event_field *fields;
+struct lttng_ctx_field {
+       const char *name;
+       struct lttng_type type;
+       void *ctx_field_callback;
+       union {
+               struct {
+                       struct perf_event **e;  /* per-cpu array */
+                       struct list_head *head;
+               } perf_counter;
+       } u;
+};
+
+struct lttng_ctx {
+       const struct lttng_ctx_field *fields;
        unsigned int nr_fields;
+       unsigned int allocated_fields;
 };
 
 struct lttng_event_desc {
index 061da25a1475bceda81c48facd6570d27a37bdf1..f583ab6ee9afd2c1d25cd23a657345f07e082137 100644 (file)
@@ -76,8 +76,8 @@ int lttng_create_ftrace_event(const char *name, struct ltt_event *event)
        }
        fields[0].name = "ip";
        fields[0].type.atype = atype_integer;
-       fields[0].type.u.basic.integer.size = sizeof(unsigned long);
-       fields[0].type.u.basic.integer.alignment = ltt_alignof(unsigned long);
+       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.reverse_byte_order = 0;
        fields[0].type.u.basic.integer.base = 16;
@@ -85,8 +85,8 @@ int lttng_create_ftrace_event(const char *name, struct ltt_event *event)
 
        fields[1].name = "parent_ip";
        fields[1].type.atype = atype_integer;
-       fields[1].type.u.basic.integer.size = sizeof(unsigned long);
-       fields[1].type.u.basic.integer.alignment = ltt_alignof(unsigned long);
+       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.reverse_byte_order = 0;
        fields[1].type.u.basic.integer.base = 16;
index 96e7509c328bedb3211e3e3e3dfc4e4d6450f4a8..87806e37240695b6d2452b9e39d22a3f482769f7 100644 (file)
@@ -65,8 +65,8 @@ int lttng_create_kprobe_event(const char *name, struct ltt_event *event)
        }
        field->name = "ip";
        field->type.atype = atype_integer;
-       field->type.u.basic.integer.size = sizeof(unsigned long);
-       field->type.u.basic.integer.alignment = ltt_alignof(unsigned long);
+       field->type.u.basic.integer.size = sizeof(unsigned long) * CHAR_BIT;
+       field->type.u.basic.integer.alignment = ltt_alignof(unsigned long) * CHAR_BIT;
        field->type.u.basic.integer.signedness = 0;
        field->type.u.basic.integer.reverse_byte_order = 0;
        field->type.u.basic.integer.base = 16;
This page took 0.033172 seconds and 4 git commands to generate.