#define BLKGETSIZE64 _IOR(0x12,114,size_t)
#endif
-static inline int ioprio_set(int which, int who, int ioprio)
-{
- return syscall(__NR_ioprio_set, which, who, ioprio);
-}
-
-enum {
- IOPRIO_WHO_PROCESS = 1,
- IOPRIO_WHO_PGRP,
- IOPRIO_WHO_USER,
-};
-
-#define IOPRIO_CLASS_SHIFT 13
-
#endif
return 1;
}
#endif
+#ifdef FIO_HAVE_IOPRIO
+ td->ioprio = (prioclass << IOPRIO_CLASS_SHIFT) | prio;
+#endif
td->filetype = FIO_TYPE_FILE;
if (!stat(jobname, &sb) && S_ISBLK(sb.st_mode))
strcpy(td->file_name, jobname);
sem_init(&td->mutex, 1, 0);
- td->ioprio = (prioclass << IOPRIO_CLASS_SHIFT) | prio;
td->clat_stat.min_val = ULONG_MAX;
td->slat_stat.min_val = ULONG_MAX;
if (strstr(p, "["))
break;
if (!check_int(p, "prio", &prio)) {
+#ifndef FIO_HAVE_IOPRIO
+ fprintf(stderr, "io priorities not available\n");
+ return 1;
+#endif
fgetpos(f, &off);
continue;
}
if (!check_int(p, "prioclass", &prioclass)) {
+#ifndef FIO_HAVE_IOPRIO
+ fprintf(stderr, "io priorities not available\n");
+ return 1;
+#endif
fgetpos(f, &off);
continue;
}
static void show_thread_status(struct thread_data *td,
struct group_run_stats *rs)
{
- int prio, prio_class;
unsigned long min, max, bw = 0;
double mean, dev, usr_cpu, sys_cpu;
if (td->runtime)
bw = td->io_bytes / td->runtime;
- prio = td->ioprio & 0xff;
- prio_class = td->ioprio >> IOPRIO_CLASS_SHIFT;
-
printf("Client%d (g=%d): err=%2d, io=%6luMiB, bw=%6luKiB/s, runt=%6lumsec\n", td->thread_number, td->groupid, td->error, td->io_bytes >> 20, bw, td->runtime);
if (calc_lat(&td->slat_stat, &min, &max, &mean, &dev))
#define fio_getaffinity(pid, ptr) \
sched_getaffinity((pid), sizeof(cpu_set_t), (ptr))
+static inline int ioprio_set(int which, int who, int ioprio)
+{
+ return syscall(__NR_ioprio_set, which, who, ioprio);
+}
+
+enum {
+ IOPRIO_WHO_PROCESS = 1,
+ IOPRIO_WHO_PGRP,
+ IOPRIO_WHO_USER,
+};
+
+#define IOPRIO_CLASS_SHIFT 13
+
#endif
#define fio_getaffinity(pid, mask) (0)
#endif
+#ifndef FIO_HAVE_IOPRIO
+#define ioprio_set(which, who, prio) (0)
+#endif
+
struct thread_data;
extern int fio_libaio_init(struct thread_data *);
extern void fio_libaio_cleanup(struct thread_data *);