It's SIGINFO on the BSD's, and works with just about any process (though obviously not everything has a customized handler). Also handily mapped to Ctrl-T.
On BSD systems you can press ^T for SIGINFO and that prints some progress information, at least for tools like dd and cp, not sure about cat and I don't have a BSD system to test. Linux doesn't have this unfortunately. GNU tools often support it (when run on BSD), it's just that the kernel doesn't.
Press ctrl-T while dd is running to sent it SIGINFO. IIRC dd status=progress was added so that dd would have something like ctrl-T on non-BSD systems. Linux lacks SIGINFO so it isn’t very widely known, nor are there many 3rd party programs that support it.
Linux has something similar to ctrl+alt+del monitoring in the form of REISUB and alia. But it is much more crude (and nowadays mostly disabled by default).
One of my favorite BSD features is SIGINFO, which is intended for applications to give some sort of information about what they’re currently doing. If you’re on macOS, I know some of the copying commands (such as dd) implement it, and a ^T in your terminal will tell you how far along it is.
For those using dd (or cp) on macOS, ^T will send the process a SIGINFO and print some additional information about progress. On Linux, SIGUSR1 will do something similar, but it's not as convenient.
^t (SIGINFO) works with a lot more than just dd. It also triggers kernel behavior (printing the current waitchannel, e.g., named lock, if one is relevant) which can be useful for diagnosing why a command (any command) is hanging. (Is it busy in userspace, or in the kernel? And if in the kernel, where?)
This makes me think, it would be nice if there was an easy built-in way to expose information about a process using the filesystem. Something like "cat /proc/$pid/fs/current_track" to get a name of a current song from a music player, or "ls /proc/$pid/fs/tabs" to list open tabs in my browser (and maybe use this to grab the html or embedded images).
I mean right now it's possible to do this using FUSE, but that's convoluted and nobody does it.
Not sure about Linux specifically, but it sounds like you’re looking for a kernel debugger that can communicate with a user mode debugger (or debuggers).
Edit: actually SystemTap mentioned in a sibling comment sounds simpler if you just need instrumentation.
I feel like despite all this progress, sysdig is still the most accessible solution at the moment. It even includes a slowish, but super simple way of tracing user space (you can even write traces from bash scripts). I wish there was a built-in Linux equivalent.
Windows has really nice tracing and WPA is pretty powerful. I've not yet seen a tool that is similarly easy to use on Linux. You can get most of the raw data from perf, but the tooling for analyzing the data isn't as good. I'd love to hear about a tool that for Linux allows doing Dawson's wait analysis easily if anyone knows of one.
I agree about the lack of source - it's really nice to be able to see exactly what the kernel is doing on Linux.
SystemTap (the kernel probing tool build into Linux) is coming along pretty well - I needed to create something to alert me when arbitrary apps set TCP_NODELAY last week, spend a little while looking at SystemTap, made a simple script that probes at tcp.setsockopt(), got the info I needed, and printed it presentably.
reply