- /*
- * Ask the sessiond for the more details on the status of the kernel tracer.
- */
- ret = lttng_get_kernel_tracer_status(&kernel_tracer_status);
- if (ret < 0) {
- ERR("Failed to get kernel tracer status: %s", lttng_strerror(ret));
- } else {
- switch (kernel_tracer_status) {
- case LTTNG_KERNEL_TRACER_STATUS_INITIALIZED:
- break;
- case LTTNG_KERNEL_TRACER_STATUS_ERR_MODULES_UNKNOWN:
- MSG("\tKernel module loading failed");
- break;
- case LTTNG_KERNEL_TRACER_STATUS_ERR_MODULES_MISSING:
- MSG("\tMissing one or more required kernel modules");
- break;
- case LTTNG_KERNEL_TRACER_STATUS_ERR_MODULES_SIGNATURE:
- MSG("\tKernel module signature error prevented loading of one or more required kernel modules");
- break;
- case LTTNG_KERNEL_TRACER_STATUS_ERR_NEED_ROOT:
- MSG("\tlttng-sessiond isn't running as root");
- break;
- case LTTNG_KERNEL_TRACER_STATUS_ERR_NOTIFIER:
- MSG("\tFailed to setup notifiers");
- break;
- case LTTNG_KERNEL_TRACER_STATUS_ERR_OPEN_PROC_LTTNG:
- MSG("\tlttng-sessiond failed to open proc lttng");
- break;
- case LTTNG_KERNEL_TRACER_STATUS_ERR_VERSION_MISMATCH:
- MSG("\tVersion mismatch between kernel tracer and kernel tracer ABI");
- break;
- default:
- MSG("\tUnknown kernel tracer status (%d)", kernel_tracer_status);
- break;
- }
- MSG("\tConsult lttng-sessiond logs for more information");
+
+ if (!msg_already_printed) {
+ LOG(error ? PRINT_ERR : PRINT_WARN,
+ "Failed to enable channel `%s` under session `%s`: %s",
+ channel_name,
+ session_name,
+ lttng_strerror(ret));
+ }
+
+ if (opt_kernel) {
+ print_kernel_tracer_status_error();