mirror of
https://github.com/intel/isa-l.git
synced 2025-10-29 20:59:43 +01:00
test: Fix c99 warn in perf helper functions
Change-Id: I7e116215dc95bbca96c7285b98f5b8ec4e340ef1 Signed-off-by: Greg Tucker <greg.b.tucker@intel.com>
This commit is contained in:
@@ -166,7 +166,8 @@ static inline long long get_base_elapsed(struct perf *p) {
|
|||||||
return p->run_total;
|
return p->run_total;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int estimate_perf_iterations(struct perf *p, unsigned long long runs,
|
static inline unsigned long long estimate_perf_iterations(struct perf *p,
|
||||||
|
unsigned long long runs,
|
||||||
unsigned long long total) {
|
unsigned long long total) {
|
||||||
total = total * runs;
|
total = total * runs;
|
||||||
if (get_base_elapsed(p) > 0)
|
if (get_base_elapsed(p) > 0)
|
||||||
@@ -176,7 +177,7 @@ static inline int estimate_perf_iterations(struct perf *p, unsigned long long ru
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define CALLIBRATE(PERF, FUNC_CALL) { \
|
#define CALLIBRATE(PERF, FUNC_CALL) { \
|
||||||
unsigned long long _iter = 1; \
|
unsigned long long _i, _iter = 1; \
|
||||||
perf_start(PERF); \
|
perf_start(PERF); \
|
||||||
FUNC_CALL; \
|
FUNC_CALL; \
|
||||||
perf_pause(PERF); \
|
perf_pause(PERF); \
|
||||||
@@ -185,7 +186,7 @@ static inline int estimate_perf_iterations(struct perf *p, unsigned long long ru
|
|||||||
_iter = estimate_perf_iterations(PERF, _iter, \
|
_iter = estimate_perf_iterations(PERF, _iter, \
|
||||||
2 * CALLIBRATE_TIME); \
|
2 * CALLIBRATE_TIME); \
|
||||||
perf_start(PERF); \
|
perf_start(PERF); \
|
||||||
for (int _i = 0; _i < _iter; _i++) { \
|
for (_i = 0; _i < _iter; _i++) { \
|
||||||
FUNC_CALL; \
|
FUNC_CALL; \
|
||||||
} \
|
} \
|
||||||
perf_stop(PERF); \
|
perf_stop(PERF); \
|
||||||
@@ -194,13 +195,13 @@ static inline int estimate_perf_iterations(struct perf *p, unsigned long long ru
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define PERFORMANCE_TEST(PERF, RUN_TIME, FUNC_CALL) { \
|
#define PERFORMANCE_TEST(PERF, RUN_TIME, FUNC_CALL) { \
|
||||||
unsigned long long _iter = (PERF)->iterations; \
|
unsigned long long _i, _iter = (PERF)->iterations; \
|
||||||
unsigned long long _run_total = RUN_TIME; \
|
unsigned long long _run_total = RUN_TIME; \
|
||||||
_run_total *= UNIT_SCALE; \
|
_run_total *= UNIT_SCALE; \
|
||||||
_iter = estimate_perf_iterations(PERF, _iter, _run_total);\
|
_iter = estimate_perf_iterations(PERF, _iter, _run_total);\
|
||||||
(PERF)->iterations = 0; \
|
(PERF)->iterations = 0; \
|
||||||
perf_start(PERF); \
|
perf_start(PERF); \
|
||||||
for (int _i = 0; _i < _iter; _i++) { \
|
for (_i = 0; _i < _iter; _i++) { \
|
||||||
FUNC_CALL; \
|
FUNC_CALL; \
|
||||||
} \
|
} \
|
||||||
perf_pause(PERF); \
|
perf_pause(PERF); \
|
||||||
@@ -212,7 +213,7 @@ static inline int estimate_perf_iterations(struct perf *p, unsigned long long ru
|
|||||||
_run_total - get_base_elapsed(PERF) + \
|
_run_total - get_base_elapsed(PERF) + \
|
||||||
(UNIT_SCALE / 16)); \
|
(UNIT_SCALE / 16)); \
|
||||||
perf_continue(PERF); \
|
perf_continue(PERF); \
|
||||||
for (int _i = 0; _i < _iter; _i++) { \
|
for (_i = 0; _i < _iter; _i++) { \
|
||||||
FUNC_CALL; \
|
FUNC_CALL; \
|
||||||
} \
|
} \
|
||||||
perf_pause(PERF); \
|
perf_pause(PERF); \
|
||||||
|
|||||||
Reference in New Issue
Block a user