From 3d0204fddb71ca377fa65952ede872583c8a7242 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Fri, 10 Apr 2020 14:06:41 +0200 Subject: various fixes for aarch64 profiling --- test/monniaux/profiling/profiling_call.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/monniaux/profiling/profiling_call.c (limited to 'test/monniaux/profiling/profiling_call.c') diff --git a/test/monniaux/profiling/profiling_call.c b/test/monniaux/profiling/profiling_call.c new file mode 100644 index 00000000..ce20241d --- /dev/null +++ b/test/monniaux/profiling/profiling_call.c @@ -0,0 +1,27 @@ +/* +For knowing how to write assembly profiling stubs. + */ + +#include +#include +#include + +typedef uint8_t md5_hash[16]; +typedef uint64_t condition_counters[2]; + +void _compcert_write_profiling_table(unsigned int nr_items, + md5_hash id_table[], + condition_counters counter_table[]); + +static md5_hash id_table[42] = {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}}; +static condition_counters counter_table[42]; + +void write_profile(void) { + _compcert_write_profiling_table(42, id_table, counter_table); +} + +static _Atomic uint64_t counter; + +void incr_counter(void) { + counter++; +} -- cgit