#include <config.h>
#endif
-#include <libltt/libltt.h>
+#include <liblttctl/lttctl.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
/* Buffer for file copy : 4k seems optimal. */
-#define BUF_SIZE 4194304
+#define BUF_SIZE 4096
enum trace_ctl_op {
CTL_OP_CREATE_START,
static enum trace_ctl_op op = CTL_OP_NONE;
static char *channel_root = NULL;
static char *trace_root = NULL;
+static char *num_threads = "1";
static int sigchld_received = 0;
printf("-x Number of subbuffers\n");
printf("-e Get XML facilities description\n");
printf("-a Append to trace\n");
+ printf("-N Number of lttd threads\n");
printf("\n");
}
trace_name = argv[argn+1];
argn++;
} else {
- printf("Specify a trace name after -n.\n", argv[argn]);
+ printf("Specify a trace name after -n.\n");
printf("\n");
ret = EINVAL;
}
break;
case 'b':
op = CTL_OP_CREATE_START;
+ break;
case 'c':
op = CTL_OP_CREATE;
break;
case 'a':
append_trace = 1;
break;
+ case 'N':
+ if(argn+1 < argc) {
+ num_threads = argv[argn+1];
+ argn++;
+ }
+ break;
default:
printf("Invalid argument '%s'.\n", argv[argn]);
printf("\n");
int ret;
if(append_trace)
ret = execlp(lttd_path, lttd_path, "-t", trace_root, "-c",
- channel_path, "-d", "-a", NULL);
+ channel_path, "-d", "-a", "-N", num_threads, NULL);
else
ret = execlp(lttd_path, lttd_path, "-t", trace_root, "-c",
- channel_path, "-d", NULL);
+ channel_path, "-d", "-N", num_threads, NULL);
if(ret) {
ret = errno;
perror("Error in executing the lttd daemon");