summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeni Dodonov <eugeni.dodonov@intel.com>2011-11-07 23:16:24 -0200
committerEugeni Dodonov <eugeni.dodonov@intel.com>2011-11-09 11:49:36 -0200
commitc3fb4014b8957bd60ff13c7744a28eddbc85ce15 (patch)
tree66fd2e94afd2d2c298e6bc4075181e17a37d2af7
parente48d1ce2f5c544e668c69fc955e176c601efa4ee (diff)
intel_gpu_top: fix a stupid miscalculation of time spent in each step
Duh... Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
-rw-r--r--tools/intel_gpu_top.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
index 6ab188f..e9f5ffe 100644
--- a/tools/intel_gpu_top.c
+++ b/tools/intel_gpu_top.c
@@ -559,7 +559,7 @@ int main(int argc, char **argv)
int i, ch;
int samples_per_sec = SAMPLES_PER_SEC;
FILE *output = NULL;
- double elapsed_time=0;
+ double elapsed_time=0, time_diff=0;
int print_headers=1;
pid_t child_pid=-1;
int child_stat;
@@ -802,14 +802,15 @@ int main(int argc, char **argv)
max_lines = num_instdone_bits;
t2 = gettime();
- elapsed_time += (t2 - t1) / 1000000.0;
+ time_diff = (t2 - t1) / 1000000.0;
+ elapsed_time += (t2 - t1) / time_diff;
#ifdef HAVE_LINUX_FEATURES
/* CPU */
get_cpu_stat(&cpu);
/* Power */
- get_power_stat(&power, battery_file, debugfs, elapsed_time);
+ get_power_stat(&power, battery_file, debugfs, time_diff);
#endif
if (interactive) {