int lttctl_create_trace(const struct lttctl_handle *h,
- char *name, enum trace_mode mode, unsigned subbuf_size, unsigned n_subbufs)
+ char *name, enum trace_mode mode, char *trace_type, unsigned subbuf_size, unsigned n_subbufs)
{
int err;
req.nlh.nlmsg_seq = 0;
strncpy(req.msg.trace_name, name, NAME_MAX);
+ strncpy(req.msg.trace_type, trace_type, NAME_MAX);
req.msg.op = OP_CREATE;
req.msg.args.new_trace.mode = mode;
req.msg.args.new_trace.subbuf_size = subbuf_size;
typedef struct lttctl_peer_msg {
char trace_name[NAME_MAX];
+ char trace_type[NAME_MAX];
enum trace_op op;
union {
struct {
int lttctl_create_trace(const struct lttctl_handle *h,
- char *name, enum trace_mode mode, unsigned subbuf_size, unsigned n_subbufs);
+ char *name, enum trace_mode mode, char *trace_type, unsigned subbuf_size, unsigned n_subbufs);
int lttctl_destroy_trace(const struct lttctl_handle *handle, char *name);
};
static char *trace_name = NULL;
+static char *trace_type = "relay";
static char *mode_name = NULL;
static unsigned subbuf_size = 0;
static unsigned n_subbufs = 0;
printf(" (optionnaly, you can set LTT_DAEMON\n");
printf(" and the LTT_FACILITIES env. vars.)\n");
printf("-t Trace root path. (ex. /root/traces/example_trace)\n");
+ printf("-T Type of trace (ex. relay)\n");
printf("-l LTT channels root path. (ex. /mnt/relayfs/ltt)\n");
printf("-z Size of the subbuffers (will be rounded to next page size)\n");
printf("-x Number of subbuffers\n");
argn++;
}
break;
+ case 'T':
+ if(argn+1 < argc) {
+ trace_type = argv[argn+1];
+ argn++;
+ } else {
+ printf("Specify a trace type after -T.\n");
+ printf("\n");
+ ret = EINVAL;
+ }
+ break;
default:
printf("Invalid argument '%s'.\n", argv[argn]);
printf("\n");
strcat(channel_path, trace_name);
- ret = lttctl_create_trace(handle, trace_name, mode, subbuf_size, n_subbufs);
+ ret = lttctl_create_trace(handle, trace_name, mode, trace_type, subbuf_size, n_subbufs);
if(ret != 0) goto create_error;
act.sa_handler = sigchld_handler;
switch(op) {
case CTL_OP_CREATE_START:
- ret = lttctl_create_trace(handle, trace_name, mode, subbuf_size,
+ ret = lttctl_create_trace(handle, trace_name, mode, trace_type, subbuf_size,
n_subbufs);
if(!ret)
ret = lttctl_start(handle, trace_name);
break;
case CTL_OP_CREATE:
- ret = lttctl_create_trace(handle, trace_name, mode, subbuf_size,
+ ret = lttctl_create_trace(handle, trace_name, mode, trace_type, subbuf_size,
n_subbufs);
break;
case CTL_OP_DESTROY: