while ((c = getopt_long(argc, argv, S_OPTS, l_opts, NULL)) != -1) {
switch (c) {
case 'i':
- dev = strdup(optarg);
+ dev = optarg;
break;
case 'o':
- output_name = strdup(optarg);
+ output_name = optarg;
break;
case 'b':
rb_batch = atoi(optarg);
static int devfd, ncpus;
static struct thread_information *thread_information;
-static char *buts_name_p;
+static char buts_name[32];
static char *dev;
static char *output_name;
static int act_mask = ~0U;
return 1;
}
+ memcpy(buts_name, buts.name, sizeof(buts_name));
trace_started = 1;
- buts_name_p = strdup(buts.name);
return 0;
}
}
snprintf(tip->fn, sizeof(tip->fn),
- "%s/block/%s/trace%d", relay_path, buts_name_p, tip->cpu);
+ "%s/block/%s/trace%d", relay_path, buts_name, tip->cpu);
tip->fd = open(tip->fn, O_RDONLY);
if (tip->fd < 0) {
perror(tip->fn);
break;
case 'o':
- output_name = strdup(optarg);
+ output_name = optarg;
break;
case 'k':
kill_running_trace = 1;
setlocale(LC_NUMERIC, "en_US");
if (!output_name)
- output_name = strdup(buts_name_p);
+ output_name = buts_name;
i = start_threads();
if (!i) {