OPT_FUNCTION_ENTRY,
};
+static struct lttng_handle *handle;
+
static struct poptOption long_options[] = {
/* longName, shortName, argInfo, argPtr, value, descrip, argDesc */
{"help", 'h', POPT_ARG_NONE, 0, OPT_HELP, 0, 0},
dom.type = LTTNG_DOMAIN_KERNEL;
}
+ handle = lttng_create_handle(NULL, &dom);
+ if (handle == NULL) {
+ ret = -1;
+ goto end;
+ }
+
/* Kernel tracer action */
if (opt_kernel) {
switch (opt_event_type) {
case LTTNG_EVENT_FUNCTION:
DBG("Calibrating kernel functions");
calibrate.type = LTTNG_CALIBRATE_FUNCTION;
- ret = lttng_calibrate(&dom, &calibrate);
+ ret = lttng_calibrate(handle, &calibrate);
break;
case LTTNG_EVENT_FUNCTION_ENTRY:
DBG("Calibrating kernel function entry");
goto end;
}
end:
+ lttng_destroy_handle(handle);
+
return ret;
}