Put message notes from kernel into a separate file for easy tracking
[blktrace.git] / btt / misc.c
index 4e721fc2691c026070152c411dfabd4fec0db17e..0ddd26003c82ff64dcca2161e15849870842a8b4 100644 (file)
@@ -100,4 +100,20 @@ void clean_bufs(void)
        }
 }
 
+char *make_dev_hdr(char *pad, size_t len, struct d_info *dip, int add_parens)
+{
+       if (dip->map == NULL) {
+               if (add_parens)
+                       snprintf(pad, len, "(%3d,%3d)",
+                                MAJOR(dip->device), MINOR(dip->device));
+               else
+                       snprintf(pad, len, "%d,%d",
+                                MAJOR(dip->device), MINOR(dip->device));
+       }
+       else
+               snprintf(pad, len, "%s", dip->map->device);
+
+       return pad;
+}
+
 void dbg_ping(void) {}