aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/profiling
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-04-10 14:06:41 +0200
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-04-10 14:06:41 +0200
commit3d0204fddb71ca377fa65952ede872583c8a7242 (patch)
tree4563132cbe6e9d103ea6e2178f7b9ecaae4c0246 /test/monniaux/profiling
parentbe92a8c71192e014caf292312865dee32ee1b901 (diff)
downloadcompcert-kvx-3d0204fddb71ca377fa65952ede872583c8a7242.tar.gz
compcert-kvx-3d0204fddb71ca377fa65952ede872583c8a7242.zip
various fixes for aarch64 profiling
Diffstat (limited to 'test/monniaux/profiling')
-rw-r--r--test/monniaux/profiling/profiling_call.c27
1 files changed, 27 insertions, 0 deletions
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 <stdint.h>
+#include <stdio.h>
+#include <errno.h>
+
+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++;
+}