Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a829cc5
Add support for ptwrite events
JosiahWhite Jun 8, 2025
31a4daf
Merge branch 'master' into ptwrite-support
cgaebel Oct 12, 2025
ddfa124
Add trace file formats to `.gitignore`
Svetlitski Feb 9, 2026
75dfa10
Add `-filter` argument to `decode` subcommand
Svetlitski Feb 4, 2026
accf21a
Copy `src/trace_writer.ml` to `src/new_trace_writer.ml`
Svetlitski Feb 9, 2026
1b216ef
Introduce new, experimental trace-writing backend
Svetlitski Dec 9, 2025
a05cd32
Add an environment variable for selecting which trace-writer implemen…
Svetlitski Feb 9, 2026
18d6160
Add support for inlined frames
Svetlitski Feb 16, 2026
7fecc44
Accept test changes
Svetlitski Apr 15, 2026
cb14d18
Use `value_or_null` template of `Hashtbl.t` instead of converting to …
Svetlitski Apr 24, 2026
3f25fbd
Add `perf.data[.old]` to gitignore
Svetlitski Apr 24, 2026
b9112ac
Unbox a tuple
Svetlitski Apr 24, 2026
ca429b3
Remove dead code from `Nonempty_vec`
Svetlitski Apr 27, 2026
489d06e
Make `LLvm_symbolizer.t` type abstract
Svetlitski Apr 27, 2026
69ed37d
Make traces smaller by omitting most additional per-slice information
Svetlitski Apr 27, 2026
17eabeb
merge
TheNumbat May 6, 2026
1167449
fix 0 payload
TheNumbat May 6, 2026
3bc6ab7
fibers
TheNumbat May 6, 2026
7f16363
revert state changes
TheNumbat May 7, 2026
fad147b
respect exn handler in runstack
TheNumbat May 7, 2026
2560677
restore assert
TheNumbat May 7, 2026
45a830f
poptrap
TheNumbat May 7, 2026
90b85bf
perform
TheNumbat May 7, 2026
1f01a20
pop exns
TheNumbat May 7, 2026
1876031
dup handle
TheNumbat May 7, 2026
280cb45
push
TheNumbat May 7, 2026
5cc1fc0
hmm
TheNumbat May 7, 2026
5259ad7
progress
TheNumbat May 11, 2026
63219ee
only return from resume if we saved the stack
TheNumbat May 11, 2026
c7e596d
debugging
TheNumbat May 13, 2026
43b7765
filter
TheNumbat May 13, 2026
d873e87
delete debug code
TheNumbat May 21, 2026
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
72 changes: 17 additions & 55 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,70 +14,31 @@ jobs:
- '5.2.0+ox'

runs-on: ${{ matrix.os }}
container:
image: alpine:latest
steps:
# This has to come first because the `actions/*` GitHub Actions require `node`,
# which isn't installed by default on this container image.
- name: "Install apk packages"
run: |
apk add autoconf bash bubblewrap build-base clang coreutils git libstdc++ \
libstdc++-dev libunwind-static linux-headers lld llvm20 llvm20-dev llvm20-static \
nodejs opam rsync upx zlib-static zstd-static
echo "PATH=/usr/lib/llvm20/bin:$PATH" >> "$GITHUB_ENV"

- name: Checkout code
uses: actions/checkout@v6

# This is necessary to avoid an error of the form 'fatal: detected dubious ownership in repository ...'
- run: git config --global --add safe.directory $(pwd)

- uses: actions/cache@v5
with:
path: ~/.opam
key: ${{ matrix.os }}-opam-${{ matrix.ocaml-version }}-1

- name: Install musl-compatible kernel headers
run: |
mkdir musl-kernel
filename='v4.19.88-1.tar.gz'
wget "https://github.com/sabotage-linux/kernel-headers/archive/refs/tags/$filename"
shasum --check <(echo "44a07e9f18033cff7840dbb112fff2862c0fb8fc $filename")
tar -xzf "$filename" -C musl-kernel --strip-components=1
echo "C_INCLUDE_PATH=$(pwd)/musl-kernel/x86/include" >> "$GITHUB_ENV"
echo "CC=musl-gcc" >> "$GITHUB_ENV"

- name: "Install apt packages"
run: |
sudo apt-get update
sudo apt-get install -y bubblewrap musl musl-tools libucl1 rsync

- name: Install upx
run: |
# The version that comes with focal is broken for musl binaries, so we have to download
# from another location.
filename='upx-ucl_3.96-2_amd64.deb'
wget "http://ftp.debian.org/debian/pool/main/u/upx-ucl/$filename"
shasum --check <(echo "0b3c901a6ae8db264a0e58aad9bbed4ef3e925b9 $filename")
sudo dpkg -i upx-ucl_3.96-2_amd64.deb

- name: Build zlib with musl
run: |
mkdir musl-zlib
filename='zlib-1.3.2.tar.gz'
wget "https://zlib.net/$filename"
shasum -a 256 --check <(echo "bb329a0a2cd0274d05519d61c667c062e06990d72e125ee2dfa8de64f0119d16 $filename")
tar -xzf "$filename" -C musl-zlib --strip-components=1
cd musl-zlib
CC=musl-gcc ./configure --libdir=/usr/lib/x86_64-linux-musl --includedir=/usr/include/x86_64-linux-musl
make -j$(nproc)
sudo make install

- name: Build zstd with musl
run: |
mkdir musl-zstd
filename='zstd-1.5.5.tar.gz'
wget "https://github.com/facebook/zstd/releases/download/v1.5.5/$filename"
shasum --check <(echo "4479ecc74300d23391d99fbebf2fddd47aed9b28 $filename")
tar -xzf "$filename" -C musl-zstd --strip-components=1
cd musl-zstd
CC=musl-gcc make -j$(nproc)
sudo make INCLUDEDIR=/usr/include/x86_64-linux-musl LIBDIR=/usr/lib/x86_64-linux-musl install
key: ${{ matrix.os }}-opam-${{ matrix.ocaml-version }}-2

- name: Use OCaml ${{ matrix.ocaml-version }}
run: |
filename='opam-2.5.0-x86_64-linux'
wget "https://github.com/ocaml/opam/releases/download/2.5.0/$filename"
shasum --check <(echo "67fb680a785f0bc7ceb57155f21786c0680ef5fe $filename")
sudo mv "$filename" /usr/local/bin/opam
sudo chmod a+x /usr/local/bin/opam

export OPAMYES=1
export OPAMJOBS=$(($(nproc) + 2))
echo "OPAMYES=1" >> "$GITHUB_ENV"
Expand All @@ -93,11 +54,12 @@ jobs:

- run: opam exec -- make PROFILE=static

- run: opam exec -- dune runtest
- run: opam exec -- dune runtest --profile=static

- name: Compress magic-trace executable
run: |
cp _build/install/default/bin/magic-trace .
chmod u+w magic-trace
ls -l magic-trace
strip magic-trace
upx -9 magic-trace
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,11 @@ _build
*.install
*.merlin
_opam
perf.data
perf.data.old
.vscode/*
!.vscode/tasks.json
*.fxt
*.fxt.old
*.fxt.gz
*.fxt.gz.old
2 changes: 2 additions & 0 deletions .ocamlformat
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
profile=janestreet
wrap-comments=false
parse-docstrings=false
1 change: 1 addition & 0 deletions direct_backend/cinaps/dune
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(library
(name magic_trace_lib_cinaps_helpers)
(no_dynlink)
(libraries core)
(preprocess
(pps ppx_jane)))
4 changes: 3 additions & 1 deletion dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
(env
(static
(flags
(:standard -cclib -static))))
(:standard -cclib -static -cclib -no-pie))
(link_flags
(:standard -cclib -static -cclib -no-pie))))

(vendored_dirs vendor)
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(lang dune 2.0)
(lang dune 3.0)
1 change: 1 addition & 0 deletions lib/magic_trace/src/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(library
(name magic_trace)
(public_name magic-trace.magic_trace)
(no_dynlink)
(foreign_stubs
(language c)
(names stop_stubs))
Expand Down
1 change: 1 addition & 0 deletions lib/magic_trace/test/dune
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(library
(name magic_trace_test)
(no_dynlink)
(libraries core expect_test_helpers_core magic_trace)
(preprocess
(pps ppx_jane)))
1 change: 1 addition & 0 deletions magic-trace.opam
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ depends: [
"owee" {>= "0.8"}
"re" {>= "1.8.0"}
"zstandard"
"vec"
]
synopsis: "Collects and displays high-resolution traces of what a process is doing"
description: "https://github.com/janestreet/magic-trace"
Loading
Loading