Suggested by Karel, add additional description to make softirq more
friendly to end-user. Discuss about this:
https://github.com/karelzak/util-linux/pull/1079
Note that, we should keep softirqs table align to kernel source code.
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Add '-S' or '--softirq' for irqtop/lsirq, instead of interrupts, show
softirqs infomation. Because there is no more description of softirq,
do not show 'NAME' column by default.
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
* user "cmp" in the function names (it does not sort)
* keep all in irq-common.c
* use column names on command line (e.g. --sort NAME)
* hardcode default to sort_result()
Signed-off-by: Karel Zak <kzak@redhat.com>
* add -J to the man page
* add note about default output
* be compatible with another util-linux tools and use -J
Signed-off-by: Karel Zak <kzak@redhat.com>
* don't care about term size and attrs when runs only once
* explicitly define signals
* resize immediately after SIGWINCH (to keep it nice for users)
Signed-off-by: Karel Zak <kzak@redhat.com>
Allocating and freeing all the time is a little bit heavier, but it is also
more robust. It is impossible to know if field lenghts stay fixed.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit add total and delta as separate columns rather than a toggle,
making output generally more informative. When using command I found that
sort order key bindings should match with first letter of column headers so
that they are as easy as possible to remember, and therefore enhancing user
experience.
Requested-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This matches with sort order n for name, and allows later usage of d for
delta without needing to go around d for description.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Change total to display delta or count depending on run mode. Add space in
between header and irqtop body. Print only number of active CPU in header.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Visible cursor is distraction. Secondly with visible cursor key commands
can be visible adding unwanted characters to end of output.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The rirst output is total count followed by number of interupts since
previous screen update. This is how the irqtop worked before libsmartcols
was added to the command.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This makes output to be automatically be nicely adjusted to optimal width.
In this commit also removes excess spaces from description strings.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Having a when and from where information is useful in situations when output
is examined later and possibly elsewhere. Typical example would be a
screenshot or output copy-paste of a terminal to a ticketing system.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The event loop takes care of the standard screen updates, signals, and user
inputs. Two nice things using even loop like this are; 1) no need for any
global variables and 2) effect of user commands is immediate.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
With very short delay one can see irqfile file descriptors pile up rather
quickly causing program to stop with too many open files error. This commit
fixes that, and removes couple other memory leaks. With these the command
should hopefully run fine for days if not even months.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>