Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 1 participant 1 message Sep 17, 2014

Subsystems (2)
lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit b7c88f86c9a5a92883effc1f119f6c7b36d087e0:

options: fix single use if / for bssplit (2014-09-15 18:51:32 -0600)

are available in the git repository at:

git://git.kernel.dk/fio.git master

for you to fetch changes up to 65ff9cd5fd5859b1547a9f7e1b2c97c6b9352f4d:

btrace2fio: move file tracking to btrace_pid (2014-09-16 20:17:55 -0600)

----------------------------------------------------------------
Jens Axboe (7):
Add basic tool to turn blktrace into fio job file Merge branch 'master' of ssh://git.kernel.dk/data/git/fio
btrace2fio: set runtime
btrace2fio: use percentage_random and add filename option
btrace2fio: cleanups and inflight hashing
Fixup data-direction to name translation
btrace2fio: move file tracking to btrace_pid

Robert Elliott (1):
fio: print io_u errors on one line

 Makefile               |   18 +-
 blktrace.c             |   71 +---
 io_ddir.h              |   12 +
 io_u.c                 |   17 +-
 iolog.c                |    9 +-
 lib/linux-dev-lookup.c |   66 ++++
 lib/linux-dev-lookup.h |    7 +
 t/btrace2fio.c         |  835 ++++++++++++++++++++++++++++++++++++++++++++++++
 8 files changed, 953 insertions(+), 82 deletions(-)
 create mode 100644 lib/linux-dev-lookup.c
 create mode 100644 lib/linux-dev-lookup.h
 create mode 100644 t/btrace2fio.c

---

Diff of recent changes:

Makefile +16 -2
index 8d86269..4350e5a 100644
@@ -110,12 +110,13 @@ endif
 
 ifeq ($(CONFIG_TARGET_OS), Linux)
   SOURCE += diskutil.c fifo.c blktrace.c cgroup.c trim.c engines/sg.c \
-		engines/binject.c
+		engines/binject.c lib/linux-dev-lookup.c
   LIBS += -lpthread -ldl
   LDFLAGS += -rdynamic
 endif
 ifeq ($(CONFIG_TARGET_OS), Android)
-  SOURCE += diskutil.c fifo.c blktrace.c trim.c profiles/tiobench.c
+  SOURCE += diskutil.c fifo.c blktrace.c trim.c profiles/tiobench.c \
+		lib/linux-dev-lookup.c
   LIBS += -ldl
   LDFLAGS += -rdynamic
 endif
@@ -182,17 +183,25 @@ T_LFSR_TEST_OBJS = t/lfsr-test.o
 T_LFSR_TEST_OBJS += lib/lfsr.o
 T_LFSR_TEST_PROGS = t/lfsr-test
 
+ifeq ($(CONFIG_TARGET_OS), Linux)
+T_BTRACE_FIO_OBJS = t/btrace2fio.o
+T_BTRACE_FIO_OBJS += fifo.o lib/flist_sort.o t/log.o lib/linux-dev-lookup.o
+T_BTRACE_FIO_PROGS = t/btrace2fio
+endif
+
 T_OBJS = $(T_SMALLOC_OBJS)
 T_OBJS += $(T_IEEE_OBJS)
 T_OBJS += $(T_ZIPF_OBJS)
 T_OBJS += $(T_AXMAP_OBJS)
 T_OBJS += $(T_LFSR_TEST_OBJS)
+T_OBJS += $(T_BTRACE_FIO_OBJS)
 
 T_PROGS = $(T_SMALLOC_PROGS)
 T_PROGS += $(T_IEEE_PROGS)
 T_PROGS += $(T_ZIPF_PROGS)
 T_PROGS += $(T_AXMAP_PROGS)
 T_PROGS += $(T_LFSR_TEST_PROGS)
+T_PROGS += $(T_BTRACE_FIO_PROGS)
 
 ifneq ($(findstring $(MAKEFLAGS),s),s)
 ifndef V
@@ -289,6 +298,11 @@ t/axmap: $(T_AXMAP_OBJS)
 t/lfsr-test: $(T_LFSR_TEST_OBJS)
 	$(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_LFSR_TEST_OBJS) $(LIBS)
 
+ifeq ($(CONFIG_TARGET_OS), Linux)
+t/btrace2fio: $(T_BTRACE_FIO_OBJS)
+	$(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_BTRACE_FIO_OBJS) $(LIBS)
+endif
+
 clean: FORCE
 	-rm -f .depend $(FIO_OBJS) $(GFIO_OBJS) $(OBJS) $(T_OBJS) $(PROGS) $(T_PROGS) core.* core gfio FIO-VERSION-FILE *.d lib/*.d crc/*.d engines/*.d profiles/*.d t/*.d config-host.mak config-host.h
 
blktrace.c +9 -62

91 lines not on this page · raw message

io_ddir.h +12 -0
index eb25c50..a23ea62 100644
@@ -10,9 +10,21 @@ enum fio_ddir {
 	DDIR_DATASYNC,
 	DDIR_SYNC_FILE_RANGE,
 	DDIR_WAIT,
+	DDIR_LAST,
 	DDIR_INVAL = -1,
 };
 
+static inline const char *io_ddir_name(enum fio_ddir ddir)
+{
+	const char *name[] = { "read", "write", "trim", "sync", "datasync",
+				"sync_file_range", "write", };
+
+	if (ddir < DDIR_LAST)
+		return name[ddir];
+
+	return "invalid";
+}
+
 enum td_ddir {
 	TD_DDIR_READ		= 1 << 0,
 	TD_DDIR_WRITE		= 1 << 1,
io_u.c +6 -11
index be2f242..7cbdb91 100644
@@ -1528,21 +1528,16 @@ err_put:
 void io_u_log_error(struct thread_data *td, struct io_u *io_u)
 {
 	enum error_type_bit eb = td_error_type(io_u->ddir, io_u->error);
-	const char *msg[] = { "read", "write", "sync", "datasync",
-				"sync_file_range", "wait", "trim" };
 
 	if (td_non_fatal_error(td, eb, io_u->error) && !td->o.error_dump)
 		return;
 
-	log_err("fio: io_u error");
-
-	if (io_u->file)
-		log_err(" on file %s", io_u->file->file_name);
-
-	log_err(": %s\n", strerror(io_u->error));
-
-	log_err("     %s offset=%llu, buflen=%lu\n", msg[io_u->ddir],
-					io_u->offset, io_u->xfer_buflen);
+	log_err("fio: io_u error%s%s: %s: %s offset=%llu, buflen=%lu\n",
+		io_u->file ? " on file " : "",
+		io_u->file ? io_u->file->file_name : "",
+		strerror(io_u->error),
+		io_ddir_name(io_u->ddir),
+		io_u->offset, io_u->xfer_buflen);
 
 	if (!td->error)
 		td_verror(td, io_u->error, "io_u error");
iolog.c +2 -7
index f9e835d..ef8b841 100644
@@ -30,17 +30,12 @@ void queue_io_piece(struct thread_data *td, struct io_piece *ipo)
 
 void log_io_u(struct thread_data *td, struct io_u *io_u)
 {
-	const char *act[] = { "read", "write", "sync", "datasync",
-				"sync_file_range", "wait", "trim" };
-
-	assert(io_u->ddir <= 6);
-
 	if (!td->o.write_iolog_file)
 		return;
 
 	fprintf(td->iolog_f, "%s %s %llu %lu\n", io_u->file->file_name,
-						act[io_u->ddir], io_u->offset,
-						io_u->buflen);
+						io_ddir_name(io_u->ddir),
+						io_u->offset, io_u->buflen);
 }
 
 void log_file(struct thread_data *td, struct fio_file *f,
lib/linux-dev-lookup.c new file +66 -0

66 lines not on this page · raw message

lib/linux-dev-lookup.h new file +7 -0
new file mode 100644
index 0000000..144f33a
@@ -0,0 +1,7 @@
+#ifndef LINUX_DEV_LOOKUP
+#define LINUX_DEV_LOOKUP
+
+int blktrace_lookup_device(const char *redirect, char *path, unsigned int maj,
+			   unsigned int min);
+
+#endif
t/btrace2fio.c new file +835 -0

835 lines not on this page · raw message