"\t-w Stop after defined time, in seconds\n" \
"\t-a Only trace specified actions. See documentation\n" \
"\t-A Give trace mask as a single value. See documentation\n" \
- "\t-b Sub buffer size in KiB\n" \
- "\t-n Number of sub buffers\n" \
+ "\t-b Sub buffer size in KiB (default 512)\n" \
+ "\t-n Number of sub buffers (default 4)\n" \
"\t-l Run in network listen mode (blktrace server)\n" \
"\t-h Run in network client mode, connecting to the given host\n" \
"\t-p Network port to use (default 8462)\n" \
* the whole structures, as the other fields
* are "static".
*/
- prev = realloc(prev->buf, sizeof(*prev) + tot_len);
+ prev = realloc(prev, sizeof(*prev) + tot_len);
prev->buf = (void *)(prev + 1);
}
return 1;
}
- if (statfs(debugfs_path, &st) < 0 || st.f_type != (long)DEBUGFS_TYPE) {
+ if (statfs(debugfs_path, &st) < 0) {
fprintf(stderr, "Invalid debug path %s: %d/%s\n",
debugfs_path, errno, strerror(errno));
return 1;
}
+ if (st.f_type != (long)DEBUGFS_TYPE) {
+ fprintf(stderr, "Debugfs is not mounted at %s\n", debugfs_path);
+ return 1;
+ }
+
if (act_mask_tmp != 0)
act_mask = act_mask_tmp;
piped_output = 1;
handle_pfds = handle_pfds_entries;
pfp = stdout;
- setvbuf(pfp, NULL, _IONBF, 0);
+ if (setvbuf(pfp, NULL, _IONBF, 0)) {
+ perror("setvbuf stdout");
+ return 1;
+ }
} else
handle_pfds = handle_pfds_file;
return 0;