X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=src%2Fworker.h;fp=src%2Fworker.h;h=091d96b6557533aa000d205c369e2d4d1e603e4f;hb=3c1c63e2c8620aeb552aba19374c7af134bb63fd;hp=6f9fde7d1f9ffd6b2c9796b851946d1c963cbfab;hpb=2ea87b7996f4f433d5d946eaf8f0d2f6fd18c144;p=stressapptest diff --git a/src/worker.h b/src/worker.h index 6f9fde7..091d96b 100644 --- a/src/worker.h +++ b/src/worker.h @@ -240,7 +240,7 @@ class WorkerThread { int64 ReadThreadTimer() { struct timeval end_time_; gettimeofday(&end_time_, NULL); - return (end_time_.tv_sec - start_time_.tv_sec)*1000000 + + return (end_time_.tv_sec - start_time_.tv_sec)*1000000ULL + (end_time_.tv_usec - start_time_.tv_usec); } // Stops per-WorkerThread timer and records thread run duration. @@ -264,10 +264,10 @@ class WorkerThread { // Calculate worker thread specific bandwidth. virtual float GetMemoryBandwidth() {return GetMemoryCopiedData() / ( - runduration_usec_ * 1.0 / 1000000);} + runduration_usec_ * 1.0 / 1000000.);} virtual float GetDeviceBandwidth() {return GetDeviceCopiedData() / ( - runduration_usec_ * 1.0 / 1000000);} + runduration_usec_ * 1.0 / 1000000.);} void set_cpu_mask(cpu_set_t *mask) { memcpy(&cpu_mask_, mask, sizeof(*mask)); @@ -421,7 +421,7 @@ class FileThread : public WorkerThread { // Record of where these pages were sourced from, and what // potentially broken components they passed through. struct PageRec { - struct Pattern *pattern; // This is the data it should contain. + class Pattern *pattern; // This is the data it should contain. void *src; // This is the memory location the data was sourced from. void *dst; // This is where it ended up. };