Replace underscores of enable-channel options
[lttng-tools.git] / lttng / commands / enable_channels.c
index f149cc74584a122670673df6351f0636bc1f8e27..1bdf60667964ff9d75614dd1e60100b5e8b9537b 100644 (file)
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <unistd.h>
+#include <inttypes.h>
 
-#include "cmd.h"
-#include "conf.h"
-#include "utils.h"
+#include "../cmd.h"
+#include "../conf.h"
+#include "../utils.h"
 
 static char *opt_channels;
 static char *opt_kernel;
@@ -59,10 +60,10 @@ static struct poptOption long_options[] = {
        {"pid",            'p', POPT_ARG_INT, &opt_pid, 0, 0, 0},
        {"discard",        0,   POPT_ARG_NONE, 0, OPT_DISCARD, 0, 0},
        {"overwrite",      0,   POPT_ARG_NONE, 0, OPT_OVERWRITE, 0, 0},
-       {"subbuf_size",    0,   POPT_ARG_DOUBLE, 0, OPT_SUBBUF_SIZE, 0, 0},
-       {"num_subbuf",     0,   POPT_ARG_INT, 0, OPT_NUM_SUBBUF, 0, 0},
-       {"switch_timer",   0,   POPT_ARG_INT, 0, OPT_SWITCH_TIMER, 0, 0},
-       {"read_timer",     0,   POPT_ARG_INT, 0, OPT_READ_TIMER, 0, 0},
+       {"subbuf-size",    0,   POPT_ARG_DOUBLE, 0, OPT_SUBBUF_SIZE, 0, 0},
+       {"num-subbuf",     0,   POPT_ARG_INT, 0, OPT_NUM_SUBBUF, 0, 0},
+       {"switch-timer",   0,   POPT_ARG_INT, 0, OPT_SWITCH_TIMER, 0, 0},
+       {"read-timer",     0,   POPT_ARG_INT, 0, OPT_READ_TIMER, 0, 0},
        {0, 0, 0, 0, 0, 0, 0}
 };
 
@@ -83,10 +84,10 @@ static void usage(FILE *ofp)
        fprintf(ofp, "Channel options:\n");
        fprintf(ofp, "      --discard            Discard event when buffers are full (default)\n");
        fprintf(ofp, "      --overwrite          Flight recorder mode\n");
-       fprintf(ofp, "      --subbuf_size        Subbuffer size in bytes (default: 4096)\n");
-       fprintf(ofp, "      --num_subbuf         Number of subbufers (default: 2)\n");
-       fprintf(ofp, "      --switch_timer       Switch timer interval in usec (default: 0)\n");
-       fprintf(ofp, "      --read_timer         Read timer interval in usec (default: 200)\n");
+       fprintf(ofp, "      --subbuf-size        Subbuffer size in bytes (default: 4096)\n");
+       fprintf(ofp, "      --num-subbuf         Number of subbufers (default: 2)\n");
+       fprintf(ofp, "      --switch-timer       Switch timer interval in usec (default: 0)\n");
+       fprintf(ofp, "      --read-timer         Read timer interval in usec (default: 200)\n");
        fprintf(ofp, "\n");
 }
 
@@ -137,7 +138,7 @@ static int enable_channel(void)
                        ret = CMD_NOT_IMPLEMENTED;
                        goto error;
                } else {
-                       ERR("Please specify a tracer (kernel or user-space)");
+                       ERR("Please specify a tracer (--kernel or --userspace)");
                        goto error;
                }
 
@@ -197,11 +198,11 @@ int cmd_enable_channels(int argc, const char **argv)
                        break;
                case OPT_SUBBUF_SIZE:
                        chan.attr.subbuf_size = atol(poptGetOptArg(pc));
-                       DBG("Channel subbuf size set to %lu", chan.attr.subbuf_size);
+                       DBG("Channel subbuf size set to %" PRIu64, chan.attr.subbuf_size);
                        break;
                case OPT_NUM_SUBBUF:
                        chan.attr.num_subbuf = atoi(poptGetOptArg(pc));
-                       DBG("Channel subbuf num set to %lu", chan.attr.num_subbuf);
+                       DBG("Channel subbuf num set to %" PRIu64, chan.attr.num_subbuf);
                        break;
                case OPT_SWITCH_TIMER:
                        chan.attr.switch_timer_interval = atoi(poptGetOptArg(pc));
This page took 0.023862 seconds and 4 git commands to generate.