Automatically hide the SWAPIN/IO columns when they are unavailable
commit9c49d594a5ddea14dcb30f0f2b7dc67018767295
authorPaul Wise <pabs3@bonedaddy.net>
Tue, 1 Feb 2022 03:31:15 +0000 (1 11:31 +0800)
committerPaul Wise <pabs3@bonedaddy.net>
Tue, 1 Feb 2022 03:31:15 +0000 (1 11:31 +0800)
treeac5b7bc587e6f0a88435998a3655ecb39837020f
parent2787b5d5a595c3a4679c5f22f817b24a55d485fe
Automatically hide the SWAPIN/IO columns when they are unavailable

Now that the Linux kernel can enable or disable data collection for them at
runtime, showing the columns when collection is disabled is even less useful,
since the previous data could still be present in the Linux kernel buffers.

Preserve the behaviour of the batch mode though, so that programs parsing
its output aren't broken by the changes to the Linux kernel, but they may
still be broken when the output changes from ?unavailable? to real data.

Since the current sorting keys code makes it hard to dynamically choose which
columns are shown or hidden, when the two columns are hidden, just skip over
displaying them or using them as sorting keys.

Rewrite the data display code to be more flexible wrt column choice though.

Suggested-by: Boian Bonev <bbonev@ipacct.com>
iotop/ui.py