#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;
{"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}
};
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");
}
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;
}
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));