aboutsummaryrefslogtreecommitdiffhomepage
path: root/trace_profile/src/noploop.c
diff options
context:
space:
mode:
Diffstat (limited to 'trace_profile/src/noploop.c')
-rw-r--r--trace_profile/src/noploop.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/trace_profile/src/noploop.c b/trace_profile/src/noploop.c
new file mode 100644
index 0000000..76e664f
--- /dev/null
+++ b/trace_profile/src/noploop.c
@@ -0,0 +1,10 @@
+#define NOP4 "nop\nnop\nnop\nnop\n"
+#define NOP32 NOP4 NOP4 NOP4 NOP4 NOP4 NOP4 NOP4 NOP4
+#define NOP256 NOP32 NOP32 NOP32 NOP32 NOP32 NOP32 NOP32 NOP32
+#define NOP2048 NOP256 NOP256 NOP256 NOP256 NOP256 NOP256 NOP256 NOP256
+
+int main() {
+ for (unsigned i = 0; i < 2000000; ++i) {
+ asm volatile(NOP2048);
+ }
+}