syscall tracing: update tests
[lttng-tools.git] / src / bin / lttng-sessiond / trace-kernel.c
index 8e074fd91b0dcbe829f8c053d32ac6e92766d32c..ab3282a17f189b9c7b288fab65a5dd224f38fe2b 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #define _GNU_SOURCE
+#define _LGPL_SOURCE
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -61,7 +62,8 @@ struct ltt_kernel_channel *trace_kernel_get_channel_by_name(
  * Find the event name for the given channel.
  */
 struct ltt_kernel_event *trace_kernel_get_event_by_name(
-               char *name, struct ltt_kernel_channel *channel)
+               char *name, struct ltt_kernel_channel *channel,
+               enum lttng_event_type type)
 {
        struct ltt_kernel_event *ev;
 
@@ -69,6 +71,8 @@ struct ltt_kernel_event *trace_kernel_get_event_by_name(
        assert(channel);
 
        cds_list_for_each_entry(ev, &channel->events_list.head, list) {
+               if (type != LTTNG_EVENT_ALL && ev->type != type)
+                       continue;
                if (strcmp(name, ev->event->name) == 0) {
                        DBG("Found event by name %s for channel %s", name,
                                        channel->channel->name);
@@ -196,6 +200,8 @@ struct ltt_kernel_context *trace_kernel_create_context(
                memcpy(&kctx->ctx, ctx, sizeof(kctx->ctx));
        }
 
+       CDS_INIT_LIST_HEAD(&kctx->list);
+
 error:
        return kctx;
 }
This page took 0.024531 seconds and 5 git commands to generate.