Whamcloud - gitweb
b=17382 obdfilter-survey gives unreasonably high numbers
[fs/lustre-release.git] / lustre / utils / obd.c
index aca2531..aad4edf 100644 (file)
@@ -533,8 +533,7 @@ static void shmem_snap(int total_threads, int live_threads)
                (prev_time.tv_sec + prev_time.tv_usec / 1000000.0);
 
         if (prev_valid &&
-            live_threads == total_threads &&
-            secs > 0.0)                    /* someone screwed with the time? */
+            secs > 1.0)                    /* someone screwed with the time? */
                 printf("%d/%d Total: %f/second\n", non_zero, total_threads, total / secs);
 
         memcpy(counter_snapshot[1], counter_snapshot[0],
@@ -715,7 +714,7 @@ int jt_opt_threads(int argc, char **argv)
 
                         thread = i;
                         argv[2] = "--device";
-                        return jt_opt_device(argc - 2, argv + 2);
+                        exit(jt_opt_device(argc - 2, argv + 2));
                 } else if (be_verbose(verbose, NULL, i, &next_thread, threads))
                         printf("%s: thread #%d (PID %d) started\n",
                                argv[0], i, rc);
@@ -1636,7 +1635,7 @@ int jt_obd_test_brw(int argc, char **argv)
                         obj_idx = (thread - 1)/nthr_per_obj;
                         objid += obj_idx;
                         stride *= nthr_per_obj;
-                        if (thread == 1)
+                        if ((thread - 1) % nthr_per_obj == 0)
                                 shared_data->offsets[obj_idx] = stride + thr_offset;
                         thr_offset += ((thread - 1) % nthr_per_obj) * len;
                 } else {
@@ -3091,7 +3090,7 @@ int jt_get_obj_version(int argc, char **argv)
         }
 
         obd_ioctl_unpack(&data, buf, sizeof rawbuf);
-        printf("0x"LPX64"\n", version);
+        printf(LPX64"\n", version);
         return 0;
 }