Remove lttng_kernel_event_create warnings
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 28 Feb 2022 20:09:12 +0000 (15:09 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 15 Jul 2024 20:58:48 +0000 (16:58 -0400)
Errors returned by lttng_kernel_event_create are handled by the caller,
and may happen e.g. when a kprobe or kretprobe symbol does not exist.
It should not generate a warning in the kernel console.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I0bd59ec35e5648fa6aa1ece3cf36714c5cc1a83e

src/lttng-abi.c

index 17041bc3bd2c74c096430aada34768499a1cc7a5..66c4a311cd03d67c44e7521bf2ac1551d0e94036 100644 (file)
@@ -2024,7 +2024,6 @@ int lttng_abi_create_event_recorder_enabler(struct file *channel_file,
                 * will stay invariant for the rest of the session.
                 */
                event = lttng_kernel_event_create(&event_enabler->parent.parent, NULL, NULL);
-               WARN_ON_ONCE(IS_ERR(event));
                lttng_event_enabler_destroy(&event_enabler->parent.parent);
                if (IS_ERR(event)) {
                        ret = PTR_ERR(event);
@@ -2058,7 +2057,6 @@ int lttng_abi_create_event_recorder_enabler(struct file *channel_file,
                 * will stay invariant for the rest of the session.
                 */
                event[0] = lttng_kernel_event_create(&event_enabler->parent.parent, NULL, &event_pair);
-               WARN_ON_ONCE(IS_ERR(event[0]));
                if (IS_ERR(event[0])) {
                        lttng_event_enabler_destroy(&event_enabler->parent.parent);
                        ret = PTR_ERR(event[0]);
@@ -2068,8 +2066,6 @@ int lttng_abi_create_event_recorder_enabler(struct file *channel_file,
                strcpy(event_pair.name, event_param->name);
                strcat(event_pair.name, "_exit");
                event[1] = lttng_kernel_event_create(&event_enabler->parent.parent, NULL, &event_pair);
-               WARN_ON_ONCE(IS_ERR(event[1]));
-
                lttng_event_enabler_destroy(&event_enabler->parent.parent);
                if (IS_ERR(event[1])) {
                        ret = PTR_ERR(event[1]);
@@ -2212,7 +2208,6 @@ int lttng_abi_create_event_counter_enabler(struct file *channel_file,
                 * will stay invariant for the rest of the session.
                 */
                event = lttng_kernel_event_create(&event_enabler->parent.parent, NULL, NULL);
-               WARN_ON_ONCE(IS_ERR(event));
                lttng_event_enabler_destroy(&event_enabler->parent.parent);
                if (IS_ERR(event)) {
                        ret = PTR_ERR(event);
@@ -2246,7 +2241,6 @@ int lttng_abi_create_event_counter_enabler(struct file *channel_file,
                 * will stay invariant for the rest of the session.
                 */
                event[0] = lttng_kernel_event_create(&event_enabler->parent.parent, NULL, &event_pair);
-               WARN_ON_ONCE(IS_ERR(event[0]));
                if (IS_ERR(event[0])) {
                        lttng_event_enabler_destroy(&event_enabler->parent.parent);
                        ret = PTR_ERR(event[0]);
@@ -2256,8 +2250,6 @@ int lttng_abi_create_event_counter_enabler(struct file *channel_file,
                strcpy(event_pair.name, event_param->name);
                strcat(event_pair.name, "_exit");
                event[1] = lttng_kernel_event_create(&event_enabler->parent.parent, NULL, &event_pair);
-               WARN_ON_ONCE(IS_ERR(event[1]));
-
                lttng_event_enabler_destroy(&event_enabler->parent.parent);
                if (IS_ERR(event[1])) {
                        ret = PTR_ERR(event[1]);
@@ -2507,7 +2499,6 @@ int lttng_abi_create_event_notifier(struct file *event_notifier_group_file,
                        goto event_notifier_error;
                }
                event = lttng_kernel_event_create(&event_notifier_enabler->parent, NULL, NULL);
-               WARN_ON_ONCE(IS_ERR(event));
                lttng_event_enabler_destroy(&event_notifier_enabler->parent);
                if (IS_ERR(event)) {
                        ret = PTR_ERR(event);
This page took 0.031539 seconds and 4 git commands to generate.