Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@

# kernel-matrix run output (build/kernel-matrix.sh)
/.kmatrix/

# compiled demo workloads (make demo) — the .c files are the source of truth
/demo/*
!/demo/*.c
!/demo/README.md
27 changes: 26 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,32 @@ postgen: | vendored-git
echo "warning: no git available (vendored or host); skipping 'git init'" >&2; \
fi

clean: clean-bpf
# Demo workloads: synthetic CPU burners with deliberately shaped call graphs,
# so there is something worth profiling on an idle box (and something worth
# recording). Built with the HOST compiler, not the BPF toolchain — these are
# ordinary userspace programs, unrelated to bin/probe.bpf.o.
#
# -O0 -fno-omit-frame-pointer is load-bearing twice over: bpf_get_stack walks
# frame pointers, and un-inlined functions are what keep their names on screen.
# -g puts file:line on each row, which is what `--repo` linking hangs off.
# See demo/README.md for what each one shows and how to record it.
DEMO_SRCS := $(wildcard demo/*.c)
DEMO_BINS := $(patsubst demo/%.c,demo/%,$(DEMO_SRCS))
DEMO_CFLAGS := -O0 -g -fno-omit-frame-pointer -Wall

.PHONY: demo
demo: $(DEMO_BINS)

# patterns.c needs -lm for sin(); linking it unconditionally is harmless.
demo/%: demo/%.c
@command -v $(CC) >/dev/null 2>&1 || { echo "error: no host C compiler ($(CC)) — install gcc or clang"; exit 1; }
$(CC) $(DEMO_CFLAGS) -o $@ $< -lm

clean: clean-bpf clean-demo
rm -rf node_modules dist src/index.jsx

.PHONY: clean-demo
clean-demo:
rm -rf $(DEMO_BINS) $(addsuffix .dSYM,$(DEMO_BINS))

.PHONY: all bundle clean postgen
Loading
Loading