static int ppi_hash_by_pid = 1;
#define RB_BATCH_DEFAULT (512)
-static int rb_batch = RB_BATCH_DEFAULT;
+static unsigned int rb_batch = RB_BATCH_DEFAULT;
static int pipeline;
static int read_events(int fd, int always_block)
{
struct per_dev_info *pdi = NULL;
- int events = 0;
+ unsigned int events = 0;
while (!is_done() && events < rb_batch) {
struct blk_io_trace *bit;
fflush(ofp);
}
-static void handle_sigint(int sig)
+static void handle_sigint(__attribute__((__unused__)) int sig)
{
done = 1;
flush_output();
return strchr(VALID_SPECS, spec) != NULL;
}
-void set_all_format_specs(char *optarg)
+void set_all_format_specs(char *option)
{
char *p;
for (p = VALID_SPECS; *p; p++)
if (override_format[(int)(*p)] == NULL)
- override_format[(int)(*p)] = strdup(optarg);
+ override_format[(int)(*p)] = strdup(option);
}
-int add_format_spec(char *optarg)
+int add_format_spec(char *option)
{
int spec = optarg[0];
return 1;
}
if (optarg[1] != ',') {
- fprintf(stderr,"Bad format specifier - need ',' %s\n", optarg);
+ fprintf(stderr,"Bad format specifier - need ',' %s\n", option);
return 1;
}
- optarg += 2;
- if (*optarg == '\0') {
- fprintf(stderr,"Bad format specifier - need fmt %s\n", optarg);
+ option += 2;
+ if (*option == '\0') {
+ fprintf(stderr,"Bad format specifier - need fmt %s\n", option);
return 1;
}
* Set both merges (front and back)
*/
if (spec == 'M') {
- override_format['B'] = strdup(optarg);
- override_format['M'] = strdup(optarg);
+ override_format['B'] = strdup(option);
+ override_format['M'] = strdup(option);
} else
- override_format[spec] = strdup(optarg);
+ override_format[spec] = strdup(option);
return 0;
}
static int act_mask = ~0U;
static int kill_running_trace;
static int use_mmap;
-static int buf_size = BUF_SIZE;
-static int buf_nr = BUF_NR;
+static unsigned int buf_size = BUF_SIZE;
+static unsigned int buf_nr = BUF_NR;
#define is_done() (*(volatile int *)(&done))
static volatile int done;
static int find_mask_map(char *string)
{
- int i;
+ unsigned int i;
for (i = 0; i < sizeof(mask_maps)/sizeof(mask_maps[0]); i++)
if (COMPARE_MASK_MAP(&mask_maps[i], string))
return -1;
}
-static int get_data_mmap(struct thread_information *tip, void *buf, int len,
- int check_magic)
+static int get_data_mmap(struct thread_information *tip, void *buf,
+ unsigned int len, int check_magic)
{
if (len > (buf_size * (tip->buf_subbuf + 1)) - tip->buf_offset) {
tip->buf_subbuf++;
return get_data_read(tip, buf, len);
}
-static void *extract_data(struct thread_information *tip, char *ofn, int nb)
+static void *extract_data(struct thread_information *tip, int nb)
{
unsigned char *buf;
{
struct thread_information *tip = arg;
int ret, pdu_len;
- char dp[64], *pdu_data;
+ char *pdu_data;
struct blk_io_trace t;
pid_t pid = getpid();
cpu_set_t cpu_mask;
trace_to_be(&t);
if (pdu_len)
- pdu_data = extract_data(tip, dp, pdu_len);
+ pdu_data = extract_data(tip, pdu_len);
/*
* now we have both trace and payload, get a lock on the
fprintf(stderr, "Usage: %s %s %s",program, blktrace_version, usage_str);
}
-static void handle_sigint(int sig)
+static void handle_sigint(__attribute__((__unused__)) int sig)
{
done = 1;
}