loglevel enable fix: enable event names, not loglevel
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 6 Dec 2011 14:07:10 +0000 (09:07 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 6 Dec 2011 14:07:10 +0000 (09:07 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust/ltt-events.c
liblttng-ust/ltt-probes.c

index e3fd3f79fdd9bb913a3f01987866a4c08e57ee7d..b2c3a46f8a6cf3bdab1709a8fcdba2fa803a422e 100644 (file)
@@ -135,6 +135,7 @@ int pending_probe_fix_events(const struct lttng_event_desc *desc)
        size_t name_len = strlen(name) + 1;
        uint32_t hash = jhash(name, name_len - 1, 0);
        int ret = 0;
+       struct lttng_ust_event event_param;
 
        /*
         * For this event, we need to lookup the loglevel. If active (in
@@ -154,15 +155,19 @@ int pending_probe_fix_events(const struct lttng_event_desc *desc)
                                struct ltt_event *ev;
                                int ret;
 
+                               memcpy(&event_param, &sl->event_param,
+                                               sizeof(event_param));
+                               memcpy(event_param.name,
+                                       desc->name,
+                                       sizeof(event_param.name));
                                /* create event */
                                ret = ltt_event_create(sl->chan,
-                                       &sl->event_param, NULL,
+                                       &event_param, NULL,
                                        &ev);
-                               /*
-                                * TODO: report error.
-                                */
-                               if (ret)
+                               if (ret) {
+                                       DBG("Error creating event");
                                        continue;
+                               }
                                cds_list_add(&ev->loglevel_list,
                                        &sl->events);
                        }
index 8571c84dc176ccde92529e7b6a643ee0dc011204..25eb3f608c95cb6cf1e3f8708ca2133c7d538c7e 100644 (file)
@@ -239,28 +239,35 @@ void _probes_create_loglevel_events(struct loglevel_entry *entry,
                                struct session_loglevel *loglevel)
 {
        struct lttng_probe_desc *probe_desc;
+       struct lttng_ust_event event_param;
        int i;
 
        cds_list_for_each_entry(probe_desc, &probe_list, head) {
                for (i = 0; i < probe_desc->nr_events; i++) {
                        const struct tracepoint_loglevel_entry *ev_ll;
+                       const struct lttng_event_desc *event_desc;
 
-                       if (!(probe_desc->event_desc[i]->loglevel))
+                       event_desc = probe_desc->event_desc[i];
+                       if (!(event_desc->loglevel))
                                continue;
-                       ev_ll = *probe_desc->event_desc[i]->loglevel;
+                       ev_ll = *event_desc->loglevel;
                        if (!strcmp(ev_ll->identifier, entry->name)) {
                                struct ltt_event *ev;
                                int ret;
 
+                               memcpy(&event_param, &loglevel->event_param,
+                                               sizeof(event_param));
+                               memcpy(event_param.name,
+                                       event_desc->name,
+                                       sizeof(event_param.name));
                                /* create event */
                                ret = ltt_event_create(loglevel->chan,
-                                       &loglevel->event_param, NULL,
+                                       &event_param, NULL,
                                        &ev);
-                               /*
-                                * TODO: report error.
-                                */
-                               if (ret)
+                               if (ret) {
+                                       DBG("Error creating event");
                                        continue;
+                               }
                                cds_list_add(&ev->loglevel_list,
                                        &loglevel->events);
                        }
This page took 0.028484 seconds and 4 git commands to generate.