Pass arch/os in probe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/arch/arch-alpha.h b/arch/arch-alpha.h
index e8132a0..c0f784f 100644
--- a/arch/arch-alpha.h
+++ b/arch/arch-alpha.h
@@ -1,7 +1,7 @@
#ifndef ARCH_ALPHA_H
#define ARCH_ALPHA_H
-#define ARCH (arch_alpha)
+#define FIO_ARCH (arch_alpha)
#ifndef __NR_ioprio_set
#define __NR_ioprio_set 442
diff --git a/arch/arch-arm.h b/arch/arch-arm.h
index b0cfd80..658b688 100644
--- a/arch/arch-arm.h
+++ b/arch/arch-arm.h
@@ -1,7 +1,7 @@
#ifndef ARCH_ARM_H
#define ARCH_ARM_H
-#define ARCH (arch_arm)
+#define FIO_ARCH (arch_arm)
#ifndef __NR_ioprio_set
#define __NR_ioprio_set 314
diff --git a/arch/arch-generic.h b/arch/arch-generic.h
index c7b0ca0..a0b71f8 100644
--- a/arch/arch-generic.h
+++ b/arch/arch-generic.h
@@ -1,7 +1,7 @@
#ifndef ARCH_GENERIC_H
#define ARCH_GENERIC_H
-#define ARCH (arch_generic)
+#define FIO_ARCH (arch_generic)
#define nop do { } while (0)
#define read_barrier() __asm__ __volatile__("": : :"memory")
diff --git a/arch/arch-hppa.h b/arch/arch-hppa.h
index c865a89..c1c079e 100644
--- a/arch/arch-hppa.h
+++ b/arch/arch-hppa.h
@@ -1,7 +1,7 @@
#ifndef ARCH_HPPA_H
#define ARCH_HPPA_H
-#define ARCH (arch_hppa)
+#define FIO_ARCH (arch_hppa)
#ifndef __NR_ioprio_set
#define __NR_ioprio_set 267
diff --git a/arch/arch-ia64.h b/arch/arch-ia64.h
index 056f636..f4464c4 100644
--- a/arch/arch-ia64.h
+++ b/arch/arch-ia64.h
@@ -1,7 +1,7 @@
#ifndef ARCH_IA64_H
#define ARCH_IA64_H
-#define ARCH (arch_ia64)
+#define FIO_ARCH (arch_ia64)
#ifndef __NR_ioprio_set
#define __NR_ioprio_set 1274
diff --git a/arch/arch-mips.h b/arch/arch-mips.h
index 759d3a9..0b781d1 100644
--- a/arch/arch-mips.h
+++ b/arch/arch-mips.h
@@ -1,7 +1,7 @@
#ifndef ARCH_MIPS64_H
#define ARCH_MIPS64_H
-#define ARCH (arch_mips)
+#define FIO_ARCH (arch_mips)
#ifndef __NR_ioprio_set
#define __NR_ioprio_set 314
diff --git a/arch/arch-ppc.h b/arch/arch-ppc.h
index d495a1b..b790a55 100644
--- a/arch/arch-ppc.h
+++ b/arch/arch-ppc.h
@@ -1,7 +1,7 @@
#ifndef ARCH_PPC_H
#define ARCH_PPH_H
-#define ARCH (arch_ppc)
+#define FIO_ARCH (arch_ppc)
#ifndef __NR_ioprio_set
#define __NR_ioprio_set 273
diff --git a/arch/arch-s390.h b/arch/arch-s390.h
index 0647750..fe51791 100644
--- a/arch/arch-s390.h
+++ b/arch/arch-s390.h
@@ -1,7 +1,7 @@
#ifndef ARCH_S390_H
#define ARCH_S390_H
-#define ARCH (arch_s390)
+#define FIO_ARCH (arch_s390)
#ifndef __NR_ioprio_set
#define __NR_ioprio_set 282
diff --git a/arch/arch-sh.h b/arch/arch-sh.h
index f5f313d..9acbbbe 100644
--- a/arch/arch-sh.h
+++ b/arch/arch-sh.h
@@ -3,7 +3,7 @@
#ifndef ARCH_SH_H
#define ARCH_SH_H
-#define ARCH (arch_sh)
+#define FIO_ARCH (arch_sh)
#ifndef __NR_ioprio_set
#define __NR_ioprio_set 288
diff --git a/arch/arch-sparc.h b/arch/arch-sparc.h
index cd552ab..fe47b80 100644
--- a/arch/arch-sparc.h
+++ b/arch/arch-sparc.h
@@ -1,7 +1,7 @@
#ifndef ARCH_SPARC_H
#define ARCH_SPARC_H
-#define ARCH (arch_sparc)
+#define FIO_ARCH (arch_sparc)
#ifndef __NR_ioprio_set
#define __NR_ioprio_set 196
diff --git a/arch/arch-sparc64.h b/arch/arch-sparc64.h
index 332cf91..e793ae5 100644
--- a/arch/arch-sparc64.h
+++ b/arch/arch-sparc64.h
@@ -1,7 +1,7 @@
#ifndef ARCH_SPARC64_H
#define ARCH_SPARC64_H
-#define ARCH (arch_sparc64)
+#define FIO_ARCH (arch_sparc64)
#ifndef __NR_ioprio_set
#define __NR_ioprio_set 196
diff --git a/arch/arch-x86.h b/arch/arch-x86.h
index 2e803cb..1ededd8 100644
--- a/arch/arch-x86.h
+++ b/arch/arch-x86.h
@@ -1,7 +1,7 @@
#ifndef ARCH_X86_H
#define ARCH_X86_H
-#define ARCH (arch_i386)
+#define FIO_ARCH (arch_i386)
#ifndef __NR_ioprio_set
#define __NR_ioprio_set 289
diff --git a/arch/arch-x86_64.h b/arch/arch-x86_64.h
index f2dcf49..29e681f 100644
--- a/arch/arch-x86_64.h
+++ b/arch/arch-x86_64.h
@@ -1,7 +1,7 @@
#ifndef ARCH_X86_64_h
#define ARCH_X86_64_h
-#define ARCH (arch_x86_64)
+#define FIO_ARCH (arch_x86_64)
#ifndef __NR_ioprio_set
#define __NR_ioprio_set 251
diff --git a/arch/arch.h b/arch/arch.h
index d598652..4ad49a4 100644
--- a/arch/arch.h
+++ b/arch/arch.h
@@ -8,7 +8,7 @@
#endif
enum {
- arch_x86_64,
+ arch_x86_64 = 1,
arch_i386,
arch_ppc,
arch_ia64,
@@ -21,6 +21,8 @@
arch_hppa,
arch_generic,
+
+ arch_nr,
};
enum {
diff --git a/client.c b/client.c
index 11ad1fe..8bd39a8 100644
--- a/client.c
+++ b/client.c
@@ -532,9 +532,18 @@
static void handle_probe(struct fio_net_cmd *cmd)
{
struct cmd_probe_pdu *probe = (struct cmd_probe_pdu *) cmd->payload;
+ const char *os, *arch;
- log_info("Probe: hostname=%s, be=%u, fio ver %u.%u.%u\n",
- probe->hostname, probe->bigendian, probe->fio_major,
+ os = fio_get_os_string(probe->os);
+ if (!os)
+ os = "unknown";
+
+ arch = fio_get_arch_string(probe->arch);
+ if (!arch)
+ os = "unknown";
+
+ log_info("hostname=%s, be=%u, os=%s, arch=%s, fio ver %u.%u.%u\n",
+ probe->hostname, probe->bigendian, os, arch, probe->fio_major,
probe->fio_minor, probe->fio_patch);
}
diff --git a/fio.c b/fio.c
index 6e68723..212b72e 100644
--- a/fio.c
+++ b/fio.c
@@ -77,6 +77,50 @@
#define JOB_START_TIMEOUT (5 * 1000)
+static const char *fio_os_strings[os_nr] = {
+ "Invalid",
+ "Linux",
+ "AIX",
+ "FreeBSD",
+ "HP-UX",
+ "OSX",
+ "NetBSD",
+ "Solaris",
+ "Windows"
+};
+
+static const char *fio_arch_strings[arch_nr] = {
+ "Invalid",
+ "x86-64",
+ "x86",
+ "ppc",
+ "ia64",
+ "s390",
+ "alpha",
+ "sparc",
+ "sparc64",
+ "arm",
+ "sh",
+ "hppa",
+ "generic"
+};
+
+const char *fio_get_os_string(int nr)
+{
+ if (nr < os_nr)
+ return fio_os_strings[nr];
+
+ return NULL;
+}
+
+const char *fio_get_arch_string(int nr)
+{
+ if (nr < arch_nr)
+ return fio_arch_strings[nr];
+
+ return NULL;
+}
+
void td_set_runstate(struct thread_data *td, int runstate)
{
if (td->runstate == runstate)
diff --git a/fio.h b/fio.h
index ba68067..04963cd 100644
--- a/fio.h
+++ b/fio.h
@@ -701,4 +701,7 @@
pthread_cond_signal(&td->free_cond);
}
+extern const char *fio_get_arch_string(int);
+extern const char *fio_get_os_string(int);
+
#endif
diff --git a/os/os-aix.h b/os/os-aix.h
index d21e573..2f75bf8 100644
--- a/os/os-aix.h
+++ b/os/os-aix.h
@@ -1,6 +1,8 @@
#ifndef FIO_OS_AIX_H
#define FIO_OS_AIX_H
+#define FIO_OS os_aix
+
#include <errno.h>
#include <unistd.h>
#include <sys/devinfo.h>
diff --git a/os/os-freebsd.h b/os/os-freebsd.h
index 1a4f113..875de96 100644
--- a/os/os-freebsd.h
+++ b/os/os-freebsd.h
@@ -1,6 +1,8 @@
#ifndef FIO_OS_FREEBSD_H
#define FIO_OS_FREEBSD_H
+#define FIO_OS os_freebsd
+
#include <errno.h>
#include <sys/sysctl.h>
#include <sys/disk.h>
diff --git a/os/os-hpux.h b/os/os-hpux.h
index 93240b3..5943938 100644
--- a/os/os-hpux.h
+++ b/os/os-hpux.h
@@ -1,6 +1,8 @@
#ifndef FIO_OS_HPUX_H
#define FIO_OS_HPUX_H
+#define FIO_OS os_hpux
+
#include <errno.h>
#include <unistd.h>
#include <sys/ioctl.h>
diff --git a/os/os-linux.h b/os/os-linux.h
index 2599091..828b208 100644
--- a/os/os-linux.h
+++ b/os/os-linux.h
@@ -1,6 +1,8 @@
#ifndef FIO_OS_LINUX_H
#define FIO_OS_LINUX_H
+#define FIO_OS os_linux
+
#include <sys/ioctl.h>
#include <sys/uio.h>
#include <sys/syscall.h>
diff --git a/os/os-mac.h b/os/os-mac.h
index 24e0eb5..80c49f4 100644
--- a/os/os-mac.h
+++ b/os/os-mac.h
@@ -1,6 +1,8 @@
#ifndef FIO_OS_APPLE_H
#define FIO_OS_APPLE_H
+#define FIO_OS os_mac
+
#include <errno.h>
#include <fcntl.h>
#include <sys/disk.h>
diff --git a/os/os-netbsd.h b/os/os-netbsd.h
index 5d8258b..78ac135 100644
--- a/os/os-netbsd.h
+++ b/os/os-netbsd.h
@@ -1,6 +1,8 @@
#ifndef FIO_OS_NETBSD_H
#define FIO_OS_NETBSD_H
+#define FIO_OS os_netbsd
+
#include <errno.h>
#include <sys/param.h>
#include <sys/thr.h>
diff --git a/os/os-solaris.h b/os/os-solaris.h
index ef37e49..5bf868a 100644
--- a/os/os-solaris.h
+++ b/os/os-solaris.h
@@ -1,6 +1,8 @@
#ifndef FIO_OS_SOLARIS_H
#define FIO_OS_SOLARIS_H
+#define FIO_OS os_solaris
+
#include <errno.h>
#include <malloc.h>
#include <sys/types.h>
diff --git a/os/os-windows.h b/os/os-windows.h
index 4af212d..65ba437 100644
--- a/os/os-windows.h
+++ b/os/os-windows.h
@@ -1,6 +1,8 @@
#ifndef FIO_OS_WINDOWS_H
#define FIO_OS_WINDOWS_H
+#define FIO_OS os_windows
+
#include <sys/types.h>
#include <errno.h>
#include <windows.h>
diff --git a/os/os.h b/os/os.h
index e1c285c..1218815 100644
--- a/os/os.h
+++ b/os/os.h
@@ -6,6 +6,19 @@
#include <unistd.h>
#include <stdlib.h>
+enum {
+ os_linux = 1,
+ os_aix,
+ os_freebsd,
+ os_hpux,
+ os_mac,
+ os_netbsd,
+ os_solaris,
+ os_windows,
+
+ os_nr,
+};
+
#if defined(__linux__)
#include "os-linux.h"
#elif defined(__FreeBSD__)
diff --git a/server.c b/server.c
index 1e1e9d0..4f9b362 100644
--- a/server.c
+++ b/server.c
@@ -309,6 +309,9 @@
probe.fio_minor = FIO_MINOR;
probe.fio_patch = FIO_PATCH;
+ probe.os = FIO_OS;
+ probe.arch = FIO_ARCH;
+
return fio_net_send_cmd(server_fd, FIO_NET_CMD_PROBE, &probe, sizeof(probe));
}
diff --git a/server.h b/server.h
index e9a6a37..c6e9ce2 100644
--- a/server.h
+++ b/server.h
@@ -63,6 +63,8 @@
uint8_t fio_major;
uint8_t fio_minor;
uint8_t fio_patch;
+ uint8_t os;
+ uint8_t arch;
};
struct cmd_line_pdu {