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

Add -Zmiri-trace-ffi to emit a message per FFI call #3919

Open
oli-obk opened this issue Sep 27, 2024 · 5 comments
Open

Add -Zmiri-trace-ffi to emit a message per FFI call #3919

oli-obk opened this issue Sep 27, 2024 · 5 comments
Labels
A-shims Area: This affects the external function shims C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Sep 27, 2024

Comparing miri and real evaluations can sometimes be hard due to the verbose logging of miri vs the difficulty of getting any information out of a real execution without changing its behaviour.

We could add a new flag that dumps the name and arguments of all shim invocations.

@oli-obk oli-obk added the C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement label Sep 27, 2024
@RalfJung

This comment has been minimized.

@oli-obk

This comment has been minimized.

@RalfJung

This comment has been minimized.

@oli-obk oli-obk changed the title Add -Zmiri-strace to emulate an strace dump Add -Zmiri-trace-ffi to emit a message per FFI call Sep 27, 2024
@tiif
Copy link
Contributor

tiif commented Sep 28, 2024

I propose adding the return value to this like what strace did. This will help in following the trace.

For example in this trace:

fcntl(9, F_DUPFD_CLOEXEC, 3)            = 11
epoll_ctl(11, EPOLL_CTL_ADD, 12, {events=EPOLLIN|EPOLLRDHUP|EPOLLET, data={u32=1, u64=1}}) = 0

fcntl returns the value of new file descriptor, and it is easy to see that this file descriptor is passed to epoll_ctl.

@RalfJung
Copy link
Member

Whatever we do, we should be careful not to require patching every single shim. That will be too tricky to keep consistent. Ideally, this is done in a single place.

I long wanted to reorganize shim dispatch to be more declarative; that may help here as well.

@RalfJung RalfJung added the A-shims Area: This affects the external function shims label Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-shims Area: This affects the external function shims C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement
Projects
None yet
Development

No branches or pull requests

3 participants