Add a get_jobs_eta() to return jobs eta information
[fio.git] / stat.h
diff --git a/stat.h b/stat.h
index bc4f6da483663a2d84921083863c29f4fa92c313..6f9d82a13c35a2ed041bc0c775fcc7af1ab6d4e5 100644 (file)
--- a/stat.h
+++ b/stat.h
@@ -114,6 +114,7 @@ struct group_run_stats {
 
 #define MAX_PATTERN_SIZE       512
 #define FIO_JOBNAME_SIZE       128
+#define FIO_JOBDESC_SIZE       256
 #define FIO_VERROR_SIZE                128
 
 struct thread_stat {
@@ -123,7 +124,7 @@ struct thread_stat {
        uint32_t thread_number;
        uint32_t groupid;
        uint32_t pid;
-       char description[FIO_JOBNAME_SIZE];
+       char description[FIO_JOBDESC_SIZE];
        uint32_t members;
        uint32_t unified_rw_rep;
 
@@ -204,6 +205,8 @@ struct jobs_eta {
        uint8_t run_str[];
 };
 
+extern struct jobs_eta *get_jobs_eta(int force, size_t *size);
+
 extern void stat_init(void);
 extern void stat_exit(void);
 
@@ -239,5 +242,10 @@ static inline int usec_to_msec(unsigned long *min, unsigned long *max,
 
        return 1;
 }
+/*
+ * Worst level condensing would be 1:5, so allow enough room for that
+ */
+#define __THREAD_RUNSTR_SZ(nr) ((nr) * 5)
+#define THREAD_RUNSTR_SZ       __THREAD_RUNSTR_SZ(thread_number)
 
 #endif