Merge branch 'master' of ssh://router/data/git/fio
[fio.git] / fio-ini.c
index 38d60a2d7dcff820af84989d2e8511f625d38762..73cebf220d5f761c6797993b402a556f4af0ca27 100644 (file)
--- a/fio-ini.c
+++ b/fio-ini.c
@@ -406,8 +406,12 @@ typedef int (str_cb_fn)(struct thread_data *, char *);
 
 static int check_str(char *p, char *name, str_cb_fn *cb, struct thread_data *td)
 {
 
 static int check_str(char *p, char *name, str_cb_fn *cb, struct thread_data *td)
 {
-       char *s = strstr(p, name);
+       char *s;
 
 
+       if (strncmp(p, name, strlen(name)))
+               return 1;
+
+       s = strstr(p, name);
        if (!s)
                return 1;
 
        if (!s)
                return 1;
 
@@ -422,8 +426,12 @@ static int check_str(char *p, char *name, str_cb_fn *cb, struct thread_data *td)
 
 static int check_strstore(char *p, char *name, char *dest)
 {
 
 static int check_strstore(char *p, char *name, char *dest)
 {
-       char *s = strstr(p, name);
+       char *s;
 
 
+       if (strncmp(p, name, strlen(name)))
+               return 1;
+
+       s = strstr(p, name);
        if (!s)
                return 1;
 
        if (!s)
                return 1;
 
@@ -458,6 +466,9 @@ static int check_range(char *p, char *name, unsigned long *s, unsigned long *e)
        char option[128];
        char *str, *p1, *p2;
 
        char option[128];
        char *str, *p1, *p2;
 
+       if (strncmp(p, name, strlen(name)))
+               return 1;
+
        strcpy(option, p);
        p = option;
 
        strcpy(option, p);
        p = option;
 
@@ -638,7 +649,6 @@ static int str_ioengine_cb(struct thread_data *td, char *str)
 static int str_iolog_cb(struct thread_data *td, char *file)
 {
        strncpy(td->iolog_file, file, sizeof(td->iolog_file) - 1);
 static int str_iolog_cb(struct thread_data *td, char *file)
 {
        strncpy(td->iolog_file, file, sizeof(td->iolog_file) - 1);
-
        return 0;
 }
 
        return 0;
 }
 
@@ -884,7 +894,16 @@ int parse_jobs_ini(char *file)
                                continue;
                        }
                        if (!check_str(p, "iolog", str_iolog_cb, td)) {
                                continue;
                        }
                        if (!check_str(p, "iolog", str_iolog_cb, td)) {
-                               td->iolog = 1;
+                               printf("got read iolog\n");
+                               td->read_iolog = 1;
+                               td->write_iolog = 0;
+                               fgetpos(f, &off);
+                               continue;
+                       }
+                       if (!td->read_iolog &&
+                           !check_str(p, "write_iolog", str_iolog_cb, td)) {
+                               printf("got write iolog\n");
+                               td->write_iolog = 1;
                                fgetpos(f, &off);
                                continue;
                        }
                                fgetpos(f, &off);
                                continue;
                        }