I agree with @PaulFox, this is probably a mistaken pid
value. When the terminal is paused before you press enter, the terminal is in the middle of a read
syscall. However, when it prints the terminal prompt (after you press enter and ls
runs), it does that by making a write
syscall. Note that the output from ls
is NOT where the write
syscall is coming from! That pid
would be the process id of the running ls
command.
To test that the write
syscall actually is working, run this:
# dtrace -n 'syscall::write:entry {printf("hello")}'
Then try it with your terminal (replace 'bash' with whatever you're using) as the target:
# dtrace -n 'syscall::write:entry /pid==$target/ {printf("hello")}' -c 'bash'
And post back if one of those fails to show any writes while you type stuff into your terminal.
Also note there are several versions of the write syscall that your shell might be using (although I would be surprised if it used something other than the ordinary write
):
# dtrace -ln 'syscall::*write*:entry'
ID PROVIDER MODULE FUNCTION NAME
147 syscall write entry
381 syscall writev entry
447 syscall pwrite entry
777 syscall aio_write entry
933 syscall write_nocancel entry
963 syscall writev_nocancel entry
969 syscall pwrite_nocancel entry