Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

Ctrl-T for SIGINFO is pretty useful, it would be good if Linux could pick this up.


sort by: page size:

SIGINFO is very useful. I make it a point to implement support for it whenever it makes sense. Wish Linux would get it.

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.

Isn't that siginfo?

You can send it to ping on linux to print a report line without terminating, for example.


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.

I've started to do this as well. BSD has SIGINFO (^t) for dd status, but unfortunately linux lacks that

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.

Thanks You for suggestion, now the answer is yes, nice alternative to 'top -m io' on Linux.

While 'dstat' gives some information its usefulness (at least for me) is far from 'gstat' outout.


^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?)

> DTrace (sadly, that is not available on Linux)

Sysdig is available though. It even got userspace tracers recently (including Python). Alternatively there's "perf" if you want just the kernel side.


GNU Screen can also do logging, if that helps the OP.

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.


> (GNU) dd has support for progress bar and even if not enabled, one can get statistics by sending USR1 signal to it.

And the BSDs have siginfo, so at least most of the Free OSs are covered.


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.

I added the script to http://sourceware.org/systemtap/wiki/WarStories . Check it out and others, it's pretty easy to pick up.

next

Legal | privacy