aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/trace_profile/vtune
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2025-02-21 22:14:05 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2025-02-21 22:35:26 +0100
commit4b026881591e99425c9e8a74162a15952ff92354 (patch)
tree5ee5f32ff71e9726cb05e129d52712267701821c /src/trace_profile/vtune
parentc9bfd7ea16ec63ca689734ad9dd279a8f76d88be (diff)
downloadnotes-4b026881591e99425c9e8a74162a15952ff92354.tar.gz
notes-4b026881591e99425c9e8a74162a15952ff92354.zip
vtune: initial notes
Diffstat (limited to 'src/trace_profile/vtune')
-rw-r--r--src/trace_profile/vtune/Makefile11
-rw-r--r--src/trace_profile/vtune/main.c32
2 files changed, 43 insertions, 0 deletions
diff --git a/src/trace_profile/vtune/Makefile b/src/trace_profile/vtune/Makefile
new file mode 100644
index 0000000..694e453
--- /dev/null
+++ b/src/trace_profile/vtune/Makefile
@@ -0,0 +1,11 @@
+VTUNE ?= /opt/intel/oneapi/vtune/latest
+
+main: main.c
+ gcc -o $@ $^ -I$(VTUNE)/include -L$(VTUNE)/lib64 -littnotify
+
+vtune: main
+ $(VTUNE)/bin64/vtune -collect hotspots -start-paused -- ./main
+
+clean:
+ $(RM) main
+ $(RM) -r r*hs
diff --git a/src/trace_profile/vtune/main.c b/src/trace_profile/vtune/main.c
new file mode 100644
index 0000000..8c019d3
--- /dev/null
+++ b/src/trace_profile/vtune/main.c
@@ -0,0 +1,32 @@
+#include <ittnotify.h>
+
+void init();
+void compute();
+void shutdown();
+
+int main() {
+ init();
+
+ __itt_resume();
+ compute();
+ __itt_pause();
+
+ shutdown();
+ return 0;
+}
+
+//
+
+#include <unistd.h>
+
+void init() {
+ sleep(1);
+}
+
+void compute() {
+ sleep(1);
+}
+
+void shutdown() {
+ sleep(1);
+}