From 5929016abb503b4f2923ff927b0958b71ed5e9cf Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 28 Feb 2022 15:09:12 -0500 Subject: [PATCH] Remove lttng_kernel_event_create warnings 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 Change-Id: I0bd59ec35e5648fa6aa1ece3cf36714c5cc1a83e --- src/lttng-abi.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/lttng-abi.c b/src/lttng-abi.c index 17041bc3..66c4a311 100644 --- a/src/lttng-abi.c +++ b/src/lttng-abi.c @@ -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); -- 2.34.1