From c9bfd7ea16ec63ca689734ad9dd279a8f76d88be Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Fri, 21 Feb 2025 21:52:42 +0100 Subject: perf: rename src folder --- src/trace_profile/perf.md | 2 +- src/trace_profile/perf/Makefile | 8 ++++++++ src/trace_profile/perf/noploop.c | 10 ++++++++++ src/trace_profile/src/Makefile | 8 -------- src/trace_profile/src/noploop.c | 10 ---------- 5 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 src/trace_profile/perf/Makefile create mode 100644 src/trace_profile/perf/noploop.c delete mode 100644 src/trace_profile/src/Makefile delete mode 100644 src/trace_profile/src/noploop.c (limited to 'src/trace_profile') diff --git a/src/trace_profile/perf.md b/src/trace_profile/perf.md index 0c92768..5be280c 100644 --- a/src/trace_profile/perf.md +++ b/src/trace_profile/perf.md @@ -147,7 +147,7 @@ perf script --per-event-dump ### Estimate max instructions per cycle ```c -{{#include src/noploop.c }} +{{#include perf/noploop.c }} ``` ```sh diff --git a/src/trace_profile/perf/Makefile b/src/trace_profile/perf/Makefile new file mode 100644 index 0000000..7e887b8 --- /dev/null +++ b/src/trace_profile/perf/Makefile @@ -0,0 +1,8 @@ +ipc: noploop + perf stat -e cycles,instructions -- ./noploop + +noploop: + $(CC) -o noploop noploop.c + +clean: + $(RM) noploop diff --git a/src/trace_profile/perf/noploop.c b/src/trace_profile/perf/noploop.c new file mode 100644 index 0000000..76e664f --- /dev/null +++ b/src/trace_profile/perf/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); + } +} diff --git a/src/trace_profile/src/Makefile b/src/trace_profile/src/Makefile deleted file mode 100644 index 7e887b8..0000000 --- a/src/trace_profile/src/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -ipc: noploop - perf stat -e cycles,instructions -- ./noploop - -noploop: - $(CC) -o noploop noploop.c - -clean: - $(RM) noploop diff --git a/src/trace_profile/src/noploop.c b/src/trace_profile/src/noploop.c deleted file mode 100644 index 76e664f..0000000 --- a/src/trace_profile/src/noploop.c +++ /dev/null @@ -1,10 +0,0 @@ -#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); - } -} -- cgit v1.2.3