Repository navigation
macos: record the files each process opens - #29
Draft
LalitMaganti wants to merge 1 commit into
Draft
LalitMaganti wants to merge 1 commit into
LalitMaganti wants to merge 1 commit into
Conversation
This was referenced Sep 16, 2026
LalitMaganti
added this pull request to stack #32
September 16, 2026 12:57
LalitMaganti
force-pushed
the
macos-record-3
branch
from
September 16, 2026 13:04
0ac9a2c to
eac8d78
Compare
LalitMaganti
force-pushed
the
macos-record-3
branch
from
September 16, 2026 13:10
eac8d78 to
a2b0879
Compare
LalitMaganti
force-pushed
the
macos-record-3
branch
from
September 16, 2026 13:17
a2b0879 to
97655d0
Compare
LalitMaganti
force-pushed
the
macos-record-3
branch
from
September 16, 2026 13:19
97655d0 to
d47fb2f
Compare
LalitMaganti
force-pushed
the
macos-record-3
branch
from
September 16, 2026 13:22
d47fb2f to
c0fcec0
Compare
LalitMaganti
force-pushed
the
macos-record-3
branch
from
September 16, 2026 13:25
c0fcec0 to
ed777f0
Compare
LalitMaganti
force-pushed
the
macos-record-3
branch
from
September 16, 2026 13:31
ed777f0 to
3763e27
Compare
LalitMaganti
force-pushed
the
macos-record-3
branch
from
October 18, 2026 02:20
3763e27 to
b083053
Compare
LalitMaganti
removed this pull request from stack #32
October 18, 2026 02:40
LalitMaganti
added this pull request to stack #48
October 18, 2026 02:40
This was referenced Oct 18, 2026
LalitMaganti
force-pushed
the
macos-record-3
branch
from
October 18, 2026 02:42
b083053 to
5d54f55
Compare
LalitMaganti
force-pushed
the
macos-record-3
branch
from
October 18, 2026 04:22
5d54f55 to
547818b
Compare
LalitMaganti
force-pushed
the
macos-record-3
branch
from
October 18, 2026 04:44
547818b to
90d7a44
Compare
LalitMaganti
force-pushed
the
macos-record-3
branch
2 times, most recently
from
October 18, 2026 06:13
1d0a127 to
fa58647
Compare
LalitMaganti
force-pushed
the
macos-record-3
branch
from
October 18, 2026 06:49
fa58647 to
9cb176f
Compare
LalitMaganti
force-pushed
the
macos-record-3
branch
from
October 18, 2026 06:52
9cb176f to
2273926
Compare
LalitMaganti
force-pushed
the
macos-record-3
branch
2 times, most recently
from
October 18, 2026 08:23
9cb176f to
6202236
Compare
The kernel reports each path as the program passed it, without resolving it. A path can be relative to a working directory or to a directory descriptor. Opening the root reports no path at all. Buildprof therefore follows each process's working directory and the paths behind its open descriptors, and resolves each path against them. Open flags are stored with Linux's numbers, so the UI reads them the same way on both platforms. Recordings now carry file events, so --no-file-events makes a smaller recording on macOS. Collection costs about the same either way, because the same kernel events carry the working directories.
LalitMaganti
force-pushed
the
macos-record-3
branch
from
October 18, 2026 08:45
6202236 to
440ef93
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Records the files each process opens on macOS.
Third of seven steps towards #2. Stacked on #28.
Why
File events let a recording link each file to the step that wrote it and the steps that read it. The kernel reports each path the way the program passed it, which is often relative. Buildprof has to work out the full path itself.
Changes
chdirandfchdir. A new process starts with its parent's.open,dup,dup2,fcntland close-on-exec. This resolves paths given relative to a directory descriptor./is the one open the kernel reports no path for, so it is handled separately.--no-file-events: the flag now has an effect on macOS, and produces a smaller recording. Collection costs about the same either way, because the events that carry working directories are needed regardless.A path that goes through a relative symbolic link loses its starting directory. #31 recovers most of those.
Testing
Unit tests cover translating open flags, a new process inheriting its parent's directory and descriptors, ignoring unrelated processes, and normalizing paths.