aboutsummaryrefslogtreecommitdiff
path: root/includes/benchmark.h
diff options
context:
space:
mode:
authorBurt P <pburt0@gmail.com>2019-08-10 23:11:21 -0500
committerLeandro A. F. Pereira <leandro@hardinfo.org>2019-08-14 20:02:42 -0700
commitd17909c82b03ad0427a285c66766421751546c42 (patch)
tree485588a0822984d437fcd22ed9f23f441760ca72 /includes/benchmark.h
parent30508a10bf269e5ca06226fb50c86f5249cc746a (diff)
Benchmark: fixes, user_note, verifiable test data
* fix zlib display order * fix cryptohash MiB/s calculation * revision and params for other benchmarks * allow attaching user note to bench result with -u * don't inlcude the new result value bits if they are empty/invalid in bench_value_to_str(). bench_value_from_str() doesn't need to be modified. * bench_results: clean old result cpu name for x86 * use problem_marker() from dmi_memory to mark old version bench results * benchmark: verifiable test data size and content - The test data benchmark.data is stored in a file that could be edited to change the size or content. /* to guarantee size */ gchar *get_test_data(gsize min_size); /* to checksum content */ char *md5_digest_str(const char *data, unsigned int len); Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'includes/benchmark.h')
-rw-r--r--includes/benchmark.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/includes/benchmark.h b/includes/benchmark.h
index 04182944..8af3739b 100644
--- a/includes/benchmark.h
+++ b/includes/benchmark.h
@@ -2,6 +2,7 @@
#define __BENCHMARK_H__
#include "hardinfo.h"
+#include "util_sysobj.h" /* for SEQ() */
extern ProgramParameters params;
@@ -37,6 +38,7 @@ typedef struct {
int threads_used;
int revision;
char extra[256]; /* no \n, ; or | */
+ char user_note[256]; /* no \n, ; or | */
} bench_value;
#define EMPTY_BENCH_VALUE {-1.0f,0,0,-1,""}
@@ -58,4 +60,12 @@ bench_value benchmark_crunch_for(float seconds, gint n_threads,
extern bench_value bench_results[BENCHMARK_N_ENTRIES];
+/* in bench_util.c */
+
+/* guarantee a minimum size of data
+ * or return null */
+gchar *get_test_data(gsize min_size);
+char *md5_digest_str(const char *data, unsigned int len);
+#define bench_msg(msg, ...) fprintf (stderr, "[%s] " msg "\n", __FUNCTION__, ##__VA_ARGS__)
+
#endif /* __BENCHMARK_H__ */