X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=lttng%2Fcommands%2Fcalibrate.c;h=b4d0fe04537c8be1cb1212b34ae5aca8bf739381;hp=76227e27e20f4bd3228a46ea40b0f72c7cfb44af;hb=cd80958d00fddabced5fbd60641978516a01e29e;hpb=8b270bdb4dccf5571180a9906084126e90eec949 diff --git a/lttng/commands/calibrate.c b/lttng/commands/calibrate.c index 76227e27e..b4d0fe045 100644 --- a/lttng/commands/calibrate.c +++ b/lttng/commands/calibrate.c @@ -49,6 +49,8 @@ enum { 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}, @@ -105,6 +107,12 @@ static int calibrate_lttng(void) 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) { @@ -117,7 +125,7 @@ static int calibrate_lttng(void) 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"); @@ -140,6 +148,8 @@ static int calibrate_lttng(void) goto end; } end: + lttng_destroy_handle(handle); + return ret; }