Skip to content

Commit c5794ed

Browse files
committed
updated debug-prints
1 parent 6cd6606 commit c5794ed

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

Diff for: lib/src/alloc_helper.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
int realloc_or_fail(struct measuresuite *ms, void **dest, size_t new_len) {
2929

30-
DEBUG("Reallocing to new length of %d bytes\n", new_len);
30+
DEBUG("Reallocing to new length of %lu bytes\n", new_len);
3131

3232
*dest = realloc(*dest, new_len);
3333

@@ -102,7 +102,7 @@ int init_arithmetic_results(measuresuite_t ms, struct function_tuple *fct) {
102102
/** +---------------------------------------------------------+ */
103103

104104
size_t size = ms->arg_width * ms->num_arg_out * sizeof(uint64_t);
105-
DEBUG("init_arithmetic_results, size: %d\n", size);
105+
DEBUG("init_arithmetic_results, size: %lu\n", size);
106106

107107
fct->arithmetic_results = malloc(size);
108108

Diff for: lib/src/evaluator.c

+8-6
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,17 @@ static void run_batch(struct measuresuite *ms, struct function_tuple *fct,
8383

8484
int (*func)(uint64_t * out, ...) = fct->code;
8585
assert(func != NULL);
86-
DEBUG("Function to evaluate is not NULL. Running with a batch size of %d\n",
87-
batch_size);
86+
DEBUG("Function to evaluate is not NULL (%p). Running with a batch size of "
87+
"%lu",
88+
func, batch_size);
8889

8990
while (batch_size > 0) {
9091
func(arg0, arg1, arg2, arg3, arg4, arg5);
9192
batch_size--;
9293
}
9394

9495
*count = stop_timer(ms, start_time);
96+
DEBUG("Done. Ran for %lu cycles.\n", count);
9597
}
9698

9799
int run_measurement(struct measuresuite *ms) {
@@ -105,14 +107,14 @@ int run_measurement(struct measuresuite *ms) {
105107
// START MEASUREMENT
106108
uint64_t start_time = current_timestamp();
107109

108-
DEBUG("Evaluating %d batches %d\n", ms->num_batches);
110+
DEBUG("Evaluating %lu batches\n", ms->num_batches);
109111
for (size_t batch_i = 0; batch_i < ms->num_batches; batch_i++) {
110112

111113
if (randomize(ms) != 0 || shuffle_permutations(ms) != 0) {
112114
return 1;
113115
}
114116

115-
DEBUG("Evaluating %d function %d\n", ms->num_functions);
117+
DEBUG("Evaluating %lu functions\n", ms->num_functions);
116118
// for as many functions as we need to measure
117119
for (size_t func_i = 0; func_i < ms->num_functions; func_i++) {
118120

@@ -121,7 +123,7 @@ int run_measurement(struct measuresuite *ms) {
121123
struct function_tuple *fct = &ms->functions[function_index];
122124

123125
// measure
124-
DEBUG("Run batch for function %d\n", batch_i);
126+
DEBUG("Run batch %lu for function %lu\n", batch_i, function_index);
125127
run_batch(ms, fct, &fct->cycle_results[batch_i]);
126128
}
127129

@@ -134,7 +136,7 @@ int run_measurement(struct measuresuite *ms) {
134136
struct function_tuple *prev = &ms->functions[func_i - 1];
135137

136138
// check
137-
DEBUG("Checking correctness for function %d and previous\n", func_i);
139+
DEBUG("Checking correctness for function %lu and previous\n", func_i);
138140
if (check(ms->arg_width * ms->num_arg_out, fct->arithmetic_results,
139141
prev->arithmetic_results)) {
140142
check_result = func_i;

Diff for: lib/src/loader.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static int create_new_function(measuresuite_t ms, enum load_type type,
5858
// check size and allocate more if needed
5959
if (ms->size_functions <= ms->num_functions) {
6060
ms->size_functions *= 2;
61-
DEBUG("Doubled size_functions to %d\n", ms->size_functions);
61+
DEBUG("Doubled size_functions to %lu\n", ms->size_functions);
6262
if (realloc_or_fail(ms, (void **)&ms->functions,
6363
ms->size_functions * sizeof(struct function_tuple))) {
6464
return 1;

0 commit comments

Comments
 (0)