Rename syscalls -> syscall in UI/API/ABI
[lttng-tools.git] / lttng / commands / calibrate.c
index 76227e27e20f4bd3228a46ea40b0f72c7cfb44af..e17a2fd73b12b82f11363f1150edc89f1a7a27fe 100644 (file)
@@ -47,8 +47,11 @@ enum {
        OPT_PROBE,
        OPT_FUNCTION,
        OPT_FUNCTION_ENTRY,
+       OPT_SYSCALL,
 };
 
+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},
@@ -61,6 +64,7 @@ static struct poptOption long_options[] = {
        {"probe",          0,   POPT_ARG_NONE, 0, OPT_PROBE, 0, 0},
        {"function",       0,   POPT_ARG_NONE, 0, OPT_FUNCTION, 0, 0},
        {"function:entry", 0,   POPT_ARG_NONE, 0, OPT_FUNCTION_ENTRY, 0, 0},
+       {"syscall",        0,   POPT_ARG_NONE, 0, OPT_SYSCALL, 0, 0},
        {0, 0, 0, 0, 0, 0, 0}
 };
 
@@ -85,6 +89,7 @@ static void usage(FILE *ofp)
        fprintf(ofp, "                           Dynamic function entry/return probe.\n");
        fprintf(ofp, "    --function:entry symbol\n");
        fprintf(ofp, "                           Function tracer event\n");
+       fprintf(ofp, "    --syscall              System call eventl\n");
        fprintf(ofp, "    --marker               User-space marker (deprecated)\n");
        fprintf(ofp, "\n");
 }
@@ -105,6 +110,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,11 +128,14 @@ 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");
                        break;
+               case LTTNG_EVENT_SYSCALL:
+                       DBG("Calibrating kernel syscall");
+                       break;
                default:
                        ret = CMD_NOT_IMPLEMENTED;
                        goto end;
@@ -140,6 +154,8 @@ static int calibrate_lttng(void)
                goto end;
        }
 end:
+       lttng_destroy_handle(handle);
+
        return ret;
 }
 
@@ -184,6 +200,9 @@ int cmd_calibrate(int argc, const char **argv)
                case OPT_FUNCTION_ENTRY:
                        ret = CMD_NOT_IMPLEMENTED;
                        break;
+               case OPT_SYSCALL:
+                       ret = CMD_NOT_IMPLEMENTED;
+                       break;
                default:
                        usage(stderr);
                        ret = CMD_UNDEFINED;
This page took 0.025639 seconds and 4 git commands to generate.