stdout
vim-zz opened this issue · comments
Ofer Affias commented
When running with cargo instruments I can't see any output on the screen, is there a way to enable stdout?
Colin Rofls commented
As far as I can tell, the instruments cli that we call swallows stdout from the child process, and there's no documented way to change this behaviour. The easiest workaround I can think of is to redirect stdout to a file for profiling; you could use a custom replacement of println!
to make this easier. 😢
Ofer Affias commented
understood
Sam Denty commented
It's possible to capture the stdout from any PID with:
capture() {
sudo dtrace -p "$1" -qn '
syscall::write*:entry
/pid == $target && arg0 == 1/ {
printf("%s", copyinstr(arg1, arg2));
}
'
}
# capture 1234
If I find the PID for target/debug
can confirm it works