Fix: disable JUL event on UST side
[lttng-tools.git] / src / bin / lttng-sessiond / event.c
1 /*
2 * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License, version 2 only,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 */
17
18 #define _GNU_SOURCE
19 #include <errno.h>
20 #include <urcu/list.h>
21 #include <string.h>
22
23 #include <lttng/lttng.h>
24 #include <common/error.h>
25 #include <common/sessiond-comm/sessiond-comm.h>
26
27 #include "channel.h"
28 #include "event.h"
29 #include "kernel.h"
30 #include "lttng-sessiond.h"
31 #include "ust-ctl.h"
32 #include "ust-app.h"
33 #include "trace-kernel.h"
34 #include "trace-ust.h"
35
36 /*
37 * Add unique UST event based on the event name, filter bytecode and loglevel.
38 */
39 static void add_unique_ust_event(struct lttng_ht *ht,
40 struct ltt_ust_event *event)
41 {
42 struct cds_lfht_node *node_ptr;
43 struct ltt_ust_ht_key key;
44
45 assert(ht);
46 assert(ht->ht);
47 assert(event);
48
49 key.name = event->attr.name;
50 key.filter = (struct lttng_filter_bytecode *) event->filter;
51 key.loglevel = event->attr.loglevel;
52 key.exclusion = event->exclusion;
53
54 node_ptr = cds_lfht_add_unique(ht->ht,
55 ht->hash_fct(event->node.key, lttng_ht_seed),
56 trace_ust_ht_match_event, &key, &event->node.node);
57 assert(node_ptr == &event->node.node);
58 }
59
60 /*
61 * Setup a lttng_event used to enable *all* syscall tracing.
62 */
63 static void init_syscalls_kernel_event(struct lttng_event *event)
64 {
65 assert(event);
66
67 event->name[0] = '\0';
68 /*
69 * We use LTTNG_EVENT* here since the trace kernel creation will make the
70 * right changes for the kernel.
71 */
72 event->type = LTTNG_EVENT_SYSCALL;
73 }
74
75 /*
76 * Disable kernel tracepoint event for a channel from the kernel session.
77 */
78 int event_kernel_disable_tracepoint(struct ltt_kernel_channel *kchan,
79 char *event_name)
80 {
81 int ret;
82 struct ltt_kernel_event *kevent;
83
84 assert(kchan);
85
86 kevent = trace_kernel_get_event_by_name(event_name, kchan);
87 if (kevent == NULL) {
88 ret = LTTNG_ERR_NO_EVENT;
89 goto error;
90 }
91
92 ret = kernel_disable_event(kevent);
93 if (ret < 0) {
94 ret = LTTNG_ERR_KERN_DISABLE_FAIL;
95 goto error;
96 }
97
98 DBG("Kernel event %s disable for channel %s.",
99 kevent->event->name, kchan->channel->name);
100
101 ret = LTTNG_OK;
102
103 error:
104 return ret;
105 }
106
107 /*
108 * Disable kernel tracepoint events for a channel from the kernel session.
109 */
110 int event_kernel_disable_all_tracepoints(struct ltt_kernel_channel *kchan)
111 {
112 int ret;
113 struct ltt_kernel_event *kevent;
114
115 assert(kchan);
116
117 /* For each event in the kernel session */
118 cds_list_for_each_entry(kevent, &kchan->events_list.head, list) {
119 ret = kernel_disable_event(kevent);
120 if (ret < 0) {
121 /* We continue disabling the rest */
122 continue;
123 }
124 }
125 ret = LTTNG_OK;
126 return ret;
127 }
128
129 /*
130 * Disable kernel syscall events for a channel from the kernel session.
131 */
132 int event_kernel_disable_all_syscalls(struct ltt_kernel_channel *kchan)
133 {
134 ERR("Cannot disable syscall tracing for existing session. Please destroy session instead.");
135 return LTTNG_OK; /* Return OK so disable all succeeds */
136 }
137
138 /*
139 * Disable all kernel event for a channel from the kernel session.
140 */
141 int event_kernel_disable_all(struct ltt_kernel_channel *kchan)
142 {
143 int ret;
144
145 assert(kchan);
146
147 ret = event_kernel_disable_all_tracepoints(kchan);
148 if (ret != LTTNG_OK)
149 return ret;
150 ret = event_kernel_disable_all_syscalls(kchan);
151 return ret;
152 }
153
154 /*
155 * Enable kernel tracepoint event for a channel from the kernel session.
156 */
157 int event_kernel_enable_tracepoint(struct ltt_kernel_channel *kchan,
158 struct lttng_event *event)
159 {
160 int ret;
161 struct ltt_kernel_event *kevent;
162
163 assert(kchan);
164 assert(event);
165
166 kevent = trace_kernel_get_event_by_name(event->name, kchan);
167 if (kevent == NULL) {
168 ret = kernel_create_event(event, kchan);
169 if (ret < 0) {
170 switch (-ret) {
171 case EEXIST:
172 ret = LTTNG_ERR_KERN_EVENT_EXIST;
173 break;
174 case ENOSYS:
175 ret = LTTNG_ERR_KERN_EVENT_ENOSYS;
176 break;
177 default:
178 ret = LTTNG_ERR_KERN_ENABLE_FAIL;
179 break;
180 }
181 goto end;
182 }
183 } else if (kevent->enabled == 0) {
184 ret = kernel_enable_event(kevent);
185 if (ret < 0) {
186 ret = LTTNG_ERR_KERN_ENABLE_FAIL;
187 goto end;
188 }
189 } else {
190 /* At this point, the event is considered enabled */
191 ret = LTTNG_ERR_KERN_EVENT_EXIST;
192 goto end;
193 }
194
195 ret = LTTNG_OK;
196 end:
197 return ret;
198 }
199
200 /*
201 * Enable all kernel tracepoint events of a channel of the kernel session.
202 */
203 int event_kernel_enable_all_tracepoints(struct ltt_kernel_channel *kchan,
204 int kernel_tracer_fd)
205 {
206 int size, i, ret;
207 struct ltt_kernel_event *kevent;
208 struct lttng_event *event_list = NULL;
209
210 assert(kchan);
211
212 /* For each event in the kernel session */
213 cds_list_for_each_entry(kevent, &kchan->events_list.head, list) {
214 if (kevent->enabled == 0) {
215 ret = kernel_enable_event(kevent);
216 if (ret < 0) {
217 /* Enable failed but still continue */
218 continue;
219 }
220 }
221 }
222
223 size = kernel_list_events(kernel_tracer_fd, &event_list);
224 if (size < 0) {
225 ret = LTTNG_ERR_KERN_LIST_FAIL;
226 goto end;
227 }
228
229 for (i = 0; i < size; i++) {
230 kevent = trace_kernel_get_event_by_name(event_list[i].name, kchan);
231 if (kevent == NULL) {
232 /* Default event type for enable all */
233 event_list[i].type = LTTNG_EVENT_TRACEPOINT;
234 /* Enable each single tracepoint event */
235 ret = kernel_create_event(&event_list[i], kchan);
236 if (ret < 0) {
237 /* Ignore error here and continue */
238 }
239 }
240 }
241 free(event_list);
242
243 ret = LTTNG_OK;
244 end:
245 return ret;
246 }
247
248 /*
249 * Enable all kernel sycalls events of a channel of the kernel session.
250 */
251 int event_kernel_enable_all_syscalls(struct ltt_kernel_channel *kchan,
252 int kernel_tracer_fd)
253 {
254 int ret;
255 struct lttng_event event;
256
257 assert(kchan);
258
259 init_syscalls_kernel_event(&event);
260
261 DBG("Enabling all syscall tracing");
262
263 ret = kernel_create_event(&event, kchan);
264 if (ret < 0) {
265 if (ret == -EEXIST) {
266 ret = LTTNG_ERR_KERN_EVENT_EXIST;
267 } else {
268 ret = LTTNG_ERR_KERN_ENABLE_FAIL;
269 }
270 goto end;
271 }
272
273 ret = LTTNG_OK;
274 end:
275 return ret;
276 }
277
278 /*
279 * Enable all kernel events of a channel of the kernel session.
280 */
281 int event_kernel_enable_all(struct ltt_kernel_channel *kchan,
282 int kernel_tracer_fd)
283 {
284 int tp_ret;
285
286 assert(kchan);
287
288 tp_ret = event_kernel_enable_all_tracepoints(kchan, kernel_tracer_fd);
289 if (tp_ret != LTTNG_OK) {
290 goto end;
291 }
292
293 /*
294 * Reaching this code path means that all tracepoints were enabled without
295 * errors so we ignore the error value of syscalls.
296 *
297 * At the moment, failing to enable syscalls on "lttng enable-event -a -k"
298 * is not considered an error that need to be returned to the client since
299 * tracepoints did not fail. Future work will allow us to send back
300 * multiple errors to the client in one API call.
301 */
302 (void) event_kernel_enable_all_syscalls(kchan, kernel_tracer_fd);
303
304 end:
305 return tp_ret;
306 }
307
308 /*
309 * ============================
310 * UST : The Ultimate Frontier!
311 * ============================
312 */
313
314 /*
315 * Enable all UST tracepoints for a channel from a UST session.
316 */
317 int event_ust_enable_all_tracepoints(struct ltt_ust_session *usess,
318 struct ltt_ust_channel *uchan,
319 char *filter_expression,
320 struct lttng_filter_bytecode *filter)
321 {
322 int ret, i, size;
323 struct lttng_ht_iter iter;
324 struct ltt_ust_event *uevent = NULL;
325 struct lttng_event *events = NULL;
326
327 assert(usess);
328 assert(uchan);
329
330 rcu_read_lock();
331
332 /* Enable existing events */
333 cds_lfht_for_each_entry(uchan->events->ht, &iter.iter, uevent,
334 node.node) {
335 if (uevent->enabled == 0) {
336 ret = ust_app_enable_event_glb(usess, uchan, uevent);
337 if (ret < 0) {
338 continue;
339 }
340 uevent->enabled = 1;
341 }
342 }
343
344 /* Get all UST available events */
345 size = ust_app_list_events(&events);
346 if (size < 0) {
347 ret = LTTNG_ERR_UST_LIST_FAIL;
348 goto error;
349 }
350
351 for (i = 0; i < size; i++) {
352 /*
353 * Check if event exist and if so, continue since it was enable
354 * previously.
355 */
356 uevent = trace_ust_find_event(uchan->events, events[i].name, filter,
357 events[i].loglevel, NULL);
358 if (uevent != NULL) {
359 ret = ust_app_enable_event_pid(usess, uchan, uevent,
360 events[i].pid);
361 if (ret < 0) {
362 if (ret != -LTTNG_UST_ERR_EXIST) {
363 ret = LTTNG_ERR_UST_ENABLE_FAIL;
364 goto error;
365 }
366 }
367 continue;
368 }
369
370 /* Create ust event */
371 uevent = trace_ust_create_event(&events[i], filter_expression,
372 filter, NULL);
373 if (uevent == NULL) {
374 ret = LTTNG_ERR_FATAL;
375 goto error_destroy;
376 }
377
378 /* Create event for the specific PID */
379 ret = ust_app_enable_event_pid(usess, uchan, uevent,
380 events[i].pid);
381 if (ret < 0) {
382 if (ret == -LTTNG_UST_ERR_EXIST) {
383 ret = LTTNG_ERR_UST_EVENT_EXIST;
384 goto error;
385 } else {
386 ret = LTTNG_ERR_UST_ENABLE_FAIL;
387 goto error_destroy;
388 }
389 }
390
391 uevent->enabled = 1;
392 /* Add ltt ust event to channel */
393 rcu_read_lock();
394 add_unique_ust_event(uchan->events, uevent);
395 rcu_read_unlock();
396 }
397 free(events);
398
399 rcu_read_unlock();
400 return LTTNG_OK;
401
402 error_destroy:
403 trace_ust_destroy_event(uevent);
404
405 error:
406 free(events);
407 rcu_read_unlock();
408 return ret;
409 }
410
411 /*
412 * Enable UST tracepoint event for a channel from a UST session.
413 */
414 int event_ust_enable_tracepoint(struct ltt_ust_session *usess,
415 struct ltt_ust_channel *uchan, struct lttng_event *event,
416 char *filter_expression,
417 struct lttng_filter_bytecode *filter,
418 struct lttng_event_exclusion *exclusion)
419 {
420 int ret = LTTNG_OK, to_create = 0;
421 struct ltt_ust_event *uevent;
422
423 assert(usess);
424 assert(uchan);
425 assert(event);
426
427 rcu_read_lock();
428
429 uevent = trace_ust_find_event(uchan->events, event->name, filter,
430 event->loglevel, exclusion);
431 if (uevent == NULL) {
432 uevent = trace_ust_create_event(event, filter_expression,
433 filter, exclusion);
434 if (uevent == NULL) {
435 ret = LTTNG_ERR_UST_ENABLE_FAIL;
436 goto error;
437 }
438
439 /* Valid to set it after the goto error since uevent is still NULL */
440 to_create = 1;
441 }
442
443 if (uevent->enabled) {
444 /* It's already enabled so everything is OK */
445 ret = LTTNG_ERR_UST_EVENT_ENABLED;
446 goto end;
447 }
448
449 uevent->enabled = 1;
450
451 if (to_create) {
452 /* Create event on all UST registered apps for session */
453 ret = ust_app_create_event_glb(usess, uchan, uevent);
454 } else {
455 /* Enable event on all UST registered apps for session */
456 ret = ust_app_enable_event_glb(usess, uchan, uevent);
457 }
458
459 if (ret < 0) {
460 if (ret == -LTTNG_UST_ERR_EXIST) {
461 ret = LTTNG_ERR_UST_EVENT_EXIST;
462 goto end;
463 } else {
464 ret = LTTNG_ERR_UST_ENABLE_FAIL;
465 goto error;
466 }
467 }
468
469 if (to_create) {
470 /* Add ltt ust event to channel */
471 add_unique_ust_event(uchan->events, uevent);
472 }
473
474 DBG("Event UST %s %s in channel %s", uevent->attr.name,
475 to_create ? "created" : "enabled", uchan->name);
476
477 ret = LTTNG_OK;
478
479 end:
480 rcu_read_unlock();
481 return ret;
482
483 error:
484 /*
485 * Only destroy event on creation time (not enabling time) because if the
486 * event is found in the channel (to_create == 0), it means that at some
487 * point the enable_event worked and it's thus valid to keep it alive.
488 * Destroying it also implies that we also destroy it's shadow copy to sync
489 * everyone up.
490 */
491 if (to_create) {
492 /* In this code path, the uevent was not added to the hash table */
493 trace_ust_destroy_event(uevent);
494 }
495 rcu_read_unlock();
496 return ret;
497 }
498
499 /*
500 * Disable UST tracepoint of a channel from a UST session.
501 */
502 int event_ust_disable_tracepoint(struct ltt_ust_session *usess,
503 struct ltt_ust_channel *uchan, char *event_name)
504 {
505 int ret;
506 struct ltt_ust_event *uevent;
507 struct lttng_ht_node_str *node;
508 struct lttng_ht_iter iter;
509 struct lttng_ht *ht;
510
511 assert(usess);
512 assert(uchan);
513 assert(event_name);
514
515 ht = uchan->events;
516
517 rcu_read_lock();
518
519 /*
520 * We use a custom lookup since we need the iterator for the next_duplicate
521 * call in the do while loop below.
522 */
523 cds_lfht_lookup(ht->ht, ht->hash_fct((void *) event_name, lttng_ht_seed),
524 trace_ust_ht_match_event_by_name, event_name, &iter.iter);
525 node = lttng_ht_iter_get_node_str(&iter);
526 if (node == NULL) {
527 DBG2("Trace UST event NOT found by name %s", event_name);
528 ret = LTTNG_ERR_UST_EVENT_NOT_FOUND;
529 goto error;
530 }
531
532 do {
533 uevent = caa_container_of(node, struct ltt_ust_event, node);
534 assert(uevent);
535
536 if (uevent->enabled == 0) {
537 /* It's already disabled so everything is OK */
538 goto next;
539 }
540
541 ret = ust_app_disable_event_glb(usess, uchan, uevent);
542 if (ret < 0 && ret != -LTTNG_UST_ERR_EXIST) {
543 ret = LTTNG_ERR_UST_DISABLE_FAIL;
544 goto error;
545 }
546 uevent->enabled = 0;
547
548 DBG2("Event UST %s disabled in channel %s", uevent->attr.name,
549 uchan->name);
550
551 next:
552 /* Get next duplicate event by name. */
553 cds_lfht_next_duplicate(ht->ht, trace_ust_ht_match_event_by_name,
554 event_name, &iter.iter);
555 node = lttng_ht_iter_get_node_str(&iter);
556 } while (node);
557
558 ret = LTTNG_OK;
559
560 error:
561 rcu_read_unlock();
562 return ret;
563 }
564
565 /*
566 * Disable all UST tracepoints for a channel from a UST session.
567 */
568 int event_ust_disable_all_tracepoints(struct ltt_ust_session *usess,
569 struct ltt_ust_channel *uchan)
570 {
571 int ret, i, size;
572 struct lttng_ht_iter iter;
573 struct ltt_ust_event *uevent = NULL;
574 struct lttng_event *events = NULL;
575
576 assert(usess);
577 assert(uchan);
578
579 rcu_read_lock();
580
581 /* Disabling existing events */
582 cds_lfht_for_each_entry(uchan->events->ht, &iter.iter, uevent,
583 node.node) {
584 if (uevent->enabled == 1) {
585 ret = event_ust_disable_tracepoint(usess, uchan,
586 uevent->attr.name);
587 if (ret < 0) {
588 continue;
589 }
590 }
591 }
592
593 /* Get all UST available events */
594 size = ust_app_list_events(&events);
595 if (size < 0) {
596 ret = LTTNG_ERR_UST_LIST_FAIL;
597 goto error;
598 }
599
600 for (i = 0; i < size; i++) {
601 ret = event_ust_disable_tracepoint(usess, uchan,
602 events[i].name);
603 if (ret != LTTNG_OK) {
604 /* Continue to disable the rest... */
605 continue;
606 }
607 }
608 free(events);
609
610 rcu_read_unlock();
611 return LTTNG_OK;
612
613 error:
614 free(events);
615 rcu_read_unlock();
616 return ret;
617 }
618
619 /*
620 * Enable all JUL event for a given UST session.
621 *
622 * Return LTTNG_OK on success or else a LTTNG_ERR* code.
623 */
624 int event_jul_enable_all(struct ltt_ust_session *usess,
625 struct lttng_event *event, struct lttng_filter_bytecode *filter)
626 {
627 int ret;
628 struct jul_event *jevent;
629 struct lttng_ht_iter iter;
630
631 assert(usess);
632
633 DBG("Event JUL enabling ALL events for session %" PRIu64, usess->id);
634
635 /* Enable event on JUL application through TCP socket. */
636 ret = event_jul_enable(usess, event, filter);
637 if (ret != LTTNG_OK) {
638 goto error;
639 }
640
641 /* Flag every event that they are now enabled. */
642 rcu_read_lock();
643 cds_lfht_for_each_entry(usess->domain_jul.events->ht, &iter.iter, jevent,
644 node.node) {
645 jevent->enabled = 1;
646 }
647 rcu_read_unlock();
648
649 ret = LTTNG_OK;
650
651 error:
652 return ret;
653 }
654
655 /*
656 * Enable a single JUL event for a given UST session.
657 *
658 * Return LTTNG_OK on success or else a LTTNG_ERR* code.
659 */
660 int event_jul_enable(struct ltt_ust_session *usess, struct lttng_event *event,
661 struct lttng_filter_bytecode *filter)
662 {
663 int ret, created = 0;
664 struct jul_event *jevent;
665
666 assert(usess);
667 assert(event);
668
669 DBG("Event JUL enabling %s for session %" PRIu64 " with loglevel type %d "
670 "and loglevel %d", event->name, usess->id, event->loglevel_type,
671 event->loglevel);
672
673 jevent = jul_find_event(event->name, event->loglevel, &usess->domain_jul);
674 if (!jevent) {
675 jevent = jul_create_event(event->name, filter);
676 if (!jevent) {
677 ret = LTTNG_ERR_NOMEM;
678 goto error;
679 }
680 jevent->loglevel = event->loglevel;
681 jevent->loglevel_type = event->loglevel_type;
682 created = 1;
683 }
684
685 /* Already enabled? */
686 if (jevent->enabled) {
687 goto end;
688 }
689
690 ret = jul_enable_event(jevent);
691 if (ret != LTTNG_OK) {
692 goto error;
693 }
694
695 /* If the event was created prior to the enable, add it to the domain. */
696 if (created) {
697 jul_add_event(jevent, &usess->domain_jul);
698 }
699
700 end:
701 return LTTNG_OK;
702
703 error:
704 if (created) {
705 jul_destroy_event(jevent);
706 }
707 return ret;
708 }
709
710 /*
711 * Disable a single JUL event for a given UST session.
712 *
713 * Return LTTNG_OK on success or else a LTTNG_ERR* code.
714 */
715 int event_jul_disable(struct ltt_ust_session *usess, char *event_name)
716 {
717 int ret;
718 struct jul_event *jevent;
719 struct ltt_ust_event *uevent = NULL;
720 struct ltt_ust_channel *uchan = NULL;
721 char *ust_event_name;
722
723 assert(usess);
724 assert(event_name);
725
726 DBG("Event JUL disabling %s for session %" PRIu64, event_name, usess->id);
727
728 jevent = jul_find_event_by_name(event_name, &usess->domain_jul);
729 if (!jevent) {
730 ret = LTTNG_ERR_UST_EVENT_NOT_FOUND;
731 goto error;
732 }
733
734 /* Already disabled? */
735 if (!jevent->enabled) {
736 goto end;
737 }
738
739 /*
740 * Disable it on the UST side. First get the channel reference then find
741 * the event and finally disable it.
742 */
743 uchan = trace_ust_find_channel_by_name(usess->domain_global.channels,
744 DEFAULT_JUL_CHANNEL_NAME);
745 if (!uchan) {
746 ret = LTTNG_ERR_UST_CHAN_NOT_FOUND;
747 goto error;
748 }
749
750 if (is_root) {
751 ust_event_name = DEFAULT_SYS_JUL_EVENT_NAME;
752 } else {
753 ust_event_name = DEFAULT_USER_JUL_EVENT_NAME;
754 }
755
756 /*
757 * The loglevel is hardcoded with 0 here since the JUL ust event is set
758 * with the loglevel type to ALL thus the loglevel stays 0. The event's
759 * filter is the one handling the loglevel for JUL.
760 */
761 uevent = trace_ust_find_event(uchan->events, ust_event_name,
762 jevent->filter, 0, NULL);
763 /* If the JUL event exists, it must be available on the UST side. */
764 assert(uevent);
765
766 ret = ust_app_disable_event_glb(usess, uchan, uevent);
767 if (ret < 0 && ret != -LTTNG_UST_ERR_EXIST) {
768 ret = LTTNG_ERR_UST_DISABLE_FAIL;
769 goto error;
770 }
771
772 ret = jul_disable_event(jevent);
773 if (ret != LTTNG_OK) {
774 goto error;
775 }
776
777 end:
778 return LTTNG_OK;
779
780 error:
781 return ret;
782 }
783 /*
784 * Disable all JUL event for a given UST session.
785 *
786 * Return LTTNG_OK on success or else a LTTNG_ERR* code.
787 */
788 int event_jul_disable_all(struct ltt_ust_session *usess)
789 {
790 int ret, do_disable = 0;
791 struct jul_event *jevent;
792 struct lttng_ht_iter iter;
793
794 assert(usess);
795
796 /* Enable event on JUL application through TCP socket. */
797 ret = event_jul_disable(usess, "*");
798 if (ret != LTTNG_OK) {
799 if (ret == LTTNG_ERR_UST_EVENT_NOT_FOUND) {
800 /*
801 * This means that no enable all was done before but still a user
802 * could want to disable everything even though the * wild card
803 * event does not exists.
804 */
805 do_disable = 1;
806 } else {
807 goto error;
808 }
809 }
810
811 /* Flag every event that they are now enabled. */
812 rcu_read_lock();
813 cds_lfht_for_each_entry(usess->domain_jul.events->ht, &iter.iter, jevent,
814 node.node) {
815 if (jevent->enabled && do_disable) {
816 ret = event_jul_disable(usess, jevent->name);
817 if (ret != LTTNG_OK) {
818 rcu_read_unlock();
819 goto error;
820 }
821 }
822 jevent->enabled = 0;
823 }
824 rcu_read_unlock();
825
826 ret = LTTNG_OK;
827
828 error:
829 return ret;
830 }
This page took 0.048389 seconds and 5 git commands to generate.