Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

See which files in the Linux userland are actually used #4

Open
probonopd opened this issue Dec 11, 2021 · 3 comments
Open

See which files in the Linux userland are actually used #4

probonopd opened this issue Dec 11, 2021 · 3 comments

Comments

@probonopd
Copy link
Member

probonopd commented Dec 11, 2021

I would like to see which files in the Linux userland are actually used so that I can slim down the set of shipped files accordingly.

According to https://forums.FreeBSD.org/threads/linux-compatability-monitor-files-accessed-by-linux-app.62029/post-358476 this should work but it doesn't:

FreeBSD% sudo kldload dtrace
FreeBSD% sudo dtrace -n ':linux64:linux_open:entry { printf("%s", copyinstr((uintptr_t)args[1]->path)); }'
dtrace: invalid probe specifier :linux64:linux_open:entry { printf("%s", copyinstr((uintptr_t)args[1]->path)); }: probe description :linux64:linux_open:entry does not match any probes

According to https://wiki.freebsd.org/DTrace/One-Liners this should

Trace file opens with process and filename:

FreeBSD% sudo dtrace -n 'syscall::open*:entry { printf("%s %s", execname, copyinstr(arg0)); }'
dtrace: invalid probe specifier syscall::open*:entry { printf("%s %s", execname, copyinstr(arg0)); }: probe description syscall::open*:entry does not match any probes

What am I missing?

@probonopd
Copy link
Member Author

probonopd commented Dec 11, 2021

Is something missing here?

FreeBSD% sudo dtrace -l
   ID   PROVIDER            MODULE                          FUNCTION NAME
    1     dtrace                                                     BEGIN
    2     dtrace                                                     END
    3     dtrace                                                     ERROR

dwatch -X open doesn't work either:

FreeBSD% sudo dwatch -X open
INFO Sourcing open profile [found in /usr/libexec/dwatch]
INFO Watching 'syscall::open:entry, syscall::openat:entry' ...
dtrace: failed to compile script /dev/stdin: line 1: probe description syscall::open:entry does not match any probes

@probonopd
Copy link
Member Author

Solution: Use sudo kldload dtraceall instead of sudo kldload dtrace.

@probonopd
Copy link
Member Author

probonopd commented Dec 12, 2021

Looking at which files the Linuxulator accesses still doesn't work like this:

FreeBSD% sudo dtrace -n 'linux64:*open*:entry { printf("%s %s", execname, copyinstr(arg0)); }' 
dtrace: description 'linux64:*open*:entry ' matched 5 probes
(...)
dtrace: error on enabled probe ID 1 (ID 76713: fbt:linux64:linux_openat:entry): invalid address (0xfffffe00f72adc00) in action #2 at DIF offset 12
dtrace: error on enabled probe ID 5 (ID 76477: fbt:linux64:linux_common_open:entry): invalid address (0xfffffe00f72adc00) in action #2 at DIF offset 12
dtrace: error on enabled probe ID 1 (ID 76713: fbt:linux64:linux_openat:entry): invalid address (0xfffffe00f2e7d500) in action #2 at DIF offset 12
dtrace: error on enabled probe ID 5 (ID 76477: fbt:linux64:linux_common_open:entry): invalid address (0xfffffe00f2e7d500) in action #2 at DIF offset 12

Why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant