Commit a1ccea0c authored by thomasl's avatar thomasl

fix compilation warning and printf of char % not correct (should be %%)


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6038 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 83a4bde6
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/ *******************************************************************************/
#include <stdio.h> #include <stdio.h>
#include "time_meas.h" #include "time_meas.h"
#include <math.h> #include <math.h>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
// global var for openair performance profiler // global var for openair performance profiler
int opp_enabled = 0; int opp_enabled = 0;
/* /*
double get_cpu_freq_GHz(void) { double get_cpu_freq_GHz(void) {
time_stats_t ts; time_stats_t ts;
reset_meas(&ts); reset_meas(&ts);
...@@ -42,7 +42,7 @@ double get_cpu_freq_GHz(void) { ...@@ -42,7 +42,7 @@ double get_cpu_freq_GHz(void) {
sleep(1); sleep(1);
stop_meas(&ts); stop_meas(&ts);
return (double)ts.diff/1000000000; return (double)ts.diff/1000000000;
}*/ }*/
void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_time, time_stats_t * sf_exec_time){ void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_time, time_stats_t * sf_exec_time){
...@@ -61,7 +61,7 @@ void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_ti ...@@ -61,7 +61,7 @@ void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_ti
if (ts->trials>0) { if (ts->trials>0) {
//printf("%20s: total: %10.3f ms, average: %10.3f us (%10d trials)\n", name, ts->diff/cpu_freq_GHz/1000000.0, ts->diff/ts->trials/cpu_freq_GHz/1000.0, ts->trials); //printf("%20s: total: %10.3f ms, average: %10.3f us (%10d trials)\n", name, ts->diff/cpu_freq_GHz/1000000.0, ts->diff/ts->trials/cpu_freq_GHz/1000.0, ts->trials);
fprintf(stderr, "%25s: %15.3f ms (%5.2f%); %15.3f us (%5.2f%); %15d;\n", fprintf(stderr, "%25s: %15.3f ms (%5.2f%%); %15.3f us (%5.2f%%); %15d;\n",
name, name,
(ts->diff/cpu_freq_GHz/1000000.0), (ts->diff/cpu_freq_GHz/1000000.0),
((ts->diff/cpu_freq_GHz/1000000.0)/(total_exec_time->diff/cpu_freq_GHz/1000000.0))*100, // percentage ((ts->diff/cpu_freq_GHz/1000000.0)/(total_exec_time->diff/cpu_freq_GHz/1000000.0))*100, // percentage
...@@ -82,5 +82,5 @@ double get_time_meas_us(time_stats_t *ts){ ...@@ -82,5 +82,5 @@ double get_time_meas_us(time_stats_t *ts){
if (ts->trials>0) if (ts->trials>0)
return (ts->diff/ts->trials/cpu_freq_GHz/1000.0); return (ts->diff/ts->trials/cpu_freq_GHz/1000.0);
return 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment