Leave the _dat file traces completely intact, get the CPU number from the
file in blkparse instead. Without this change, it's impossible for other
users to verify the sanity and version of a trace.
- Improved error handling
- Remove _dat files, include the payload in _out
- Support for payload > 64 bytes
- Add install target
- Improved error handling
- Remove _dat files, include the payload in _out
- Support for payload > 64 bytes
- Add install target
+ - Fix RELAYFS Kconfig selection (kernel patch)
+ - blktrace: Don't touch the stored trace, leave magic and version
+ for blkparse to see as well.
20050827:
- Various cleanups and killing unused variables
20050826:
20050827:
- Various cleanups and killing unused variables
20050826:
struct trace {
struct blk_io_trace *bit;
struct trace {
struct blk_io_trace *bit;
struct rb_node rb_node;
};
struct rb_node rb_node;
};
-static int sort_entries(void *traces, unsigned long offset)
+static inline int verify_trace(struct blk_io_trace *t)
+{
+ if (!CHECK_MAGIC(t)) {
+ fprintf(stderr, "bad trace magic %x\n", t->magic);
+ return 1;
+ }
+ if ((t->magic & 0xff) != SUPPORTED_VERSION) {
+ fprintf(stderr, "unsupported trace version %x\n",
+ t->magic & 0xff);
+ return 1;
+ }
+
+ return 0;
+}
+
+static int sort_entries(void *traces, unsigned long offset, int cpu)
{
struct blk_io_trace *bit;
struct trace *t;
{
struct blk_io_trace *bit;
struct trace *t;
bit = traces;
t = malloc(sizeof(*t));
t->bit = bit;
bit = traces;
t = malloc(sizeof(*t));
t->bit = bit;
memset(&t->rb_node, 0, sizeof(t->rb_node));
memset(&t->rb_node, 0, sizeof(t->rb_node));
+ if (verify_trace(bit))
+ break;
+
if (trace_rb_insert(t))
return -1;
if (trace_rb_insert(t))
return -1;
t = rb_entry(n, struct trace, rb_node);
bit = t->bit;
t = rb_entry(n, struct trace, rb_node);
bit = t->bit;
if (cpu > max_cpus) {
fprintf(stderr, "CPU number too large (%d)\n", cpu);
break;
if (cpu > max_cpus) {
fprintf(stderr, "CPU number too large (%d)\n", cpu);
break;
- ret = sort_entries(tb, st.st_size);
+ ret = sort_entries(tb, st.st_size, i);
if (verify_trace(&t))
exit(1);
if (verify_trace(&t))
exit(1);
- /* version is verified, stuff with CPU number now */
- t.magic = tip->cpu;
ret = write(ofd, &t, sizeof(t));
if (ret < 0) {
perror(op);
ret = write(ofd, &t, sizeof(t));
if (ret < 0) {
perror(op);