[SR-Dev] git:master: benchmark: scalars converted to unsigned long long

Daniel-Constantin Mierla miconda at gmail.com
Tue May 19 09:43:17 CEST 2009


Module: sip-router
Branch: master
Commit: 21698992bf3e046e4bd127cb0f02a7be4390ecfc
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=21698992bf3e046e4bd127cb0f02a7be4390ecfc

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Tue May 19 10:42:38 2009 +0300

benchmark: scalars converted to unsigned long long

- should fix issue with printing negative values

---

 modules_k/benchmark/benchmark.c |    2 +-
 modules_k/benchmark/benchmark.h |   14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/modules_k/benchmark/benchmark.c b/modules_k/benchmark/benchmark.c
index 1b4ede3..bca072a 100644
--- a/modules_k/benchmark/benchmark.c
+++ b/modules_k/benchmark/benchmark.c
@@ -335,7 +335,7 @@ int _bm_log_timer(unsigned int id)
 	{
 		LM_GEN1(bm_mycfg->loglevel, "benchmark (timer %s [%d]): %llu ["
 			" msgs/total/min/max/avg - LR:"
-			" %i/%lld/%lld/%lld/%f | GB: %lld/%lld/%lld/%lld/%f]\n",
+			" %i/%llu/%llu/%llu/%f | GB: %llu/%llu/%llu/%llu/%f]\n",
 			bm_mycfg->tindex[id]->name,
 			id,
 			tdiff,
diff --git a/modules_k/benchmark/benchmark.h b/modules_k/benchmark/benchmark.h
index d58a151..cc4e68e 100644
--- a/modules_k/benchmark/benchmark.h
+++ b/modules_k/benchmark/benchmark.h
@@ -58,14 +58,14 @@ typedef struct benchmark_timer
 	unsigned int id;
 	int enabled;
 	bm_timeval_t *start;    /* Current timer run */
-	long long calls;		/* Number of runs of this timer */
-	long long sum;			/* Accumulated runtime of this timer */
-	long long last_sum;		/* Accumulated runtime since last logging */
-	long long last_max;		/* Minimum in current period (between
+	unsigned long long calls;		/* Number of runs of this timer */
+	unsigned long long sum;			/* Accumulated runtime of this timer */
+	unsigned long long last_sum;	/* Accumulated runtime since last logging */
+	unsigned long long last_max;	/* Minimum in current period (between
 							   granularity) */
-	long long last_min;		/* Maximum ... */
-	long long global_max;	/* Global minimum, since start */
-	long long global_min;	/* ...    maximum ... */
+	unsigned long long last_min;	/* Maximum ... */
+	unsigned long long global_max;	/* Global minimum, since start */
+	unsigned long long global_min;	/* ...    maximum ... */
 	struct benchmark_timer *next;
 } benchmark_timer_t;
 




More information about the sr-dev mailing list