]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
irqtop: minor cleanup
authorKarel Zak <kzak@redhat.com>
Fri, 6 Mar 2020 13:11:30 +0000 (14:11 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 6 Mar 2020 13:11:30 +0000 (14:11 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/irq-common.h
sys-utils/irqtop.c

index 3a4cd6a0316553b4387b088ada44646667ed87ed..c0853bd8b2a087a46f5210df8790165da650b185 100644 (file)
@@ -1,6 +1,12 @@
+#ifndef UTIL_LINUX_H_IRQ_COMMON
+#define UTIL_LINUX_H_IRQ_COMMON
 
+#include "c.h"
+#include "nls.h"
+
+/* supported columns */
 enum {
-       COL_IRQ = 1,
+       COL_IRQ = 0,
        COL_TOTAL,
        COL_DELTA,
        COL_NAME,
@@ -28,6 +34,7 @@ typedef int (sort_fp)(const struct irq_info *, const struct irq_info *);
 
 #define DEF_SORT_FUNC  ((sort_fp *)sort_total)
 
+/* output definition */
 struct irq_output {
        int columns[__COL_COUNT * 2];
        size_t ncolumns;
@@ -73,3 +80,5 @@ sort_fp *set_sort_func(char key);
 struct libscols_table *get_scols_table(struct irq_output *out,
                                               struct irq_stat *prev,
                                               struct irq_stat **xstat);
+
+#endif /* UTIL_LINUX_H_IRQ_COMMON */
index 3e8b24bb5805c19b5fb7cb318e16eeb94c70fc1f..663f93230702aee3a39aca0f3695846dbc097c74 100644 (file)
 
 #include <libsmartcols.h>
 
-#include "c.h"
 #include "closestream.h"
 #include "monotonic.h"
-#include "nls.h"
 #include "pathnames.h"
 #include "strutils.h"
 #include "timeutils.h"
@@ -70,6 +68,7 @@
 
 #define MAX_EVENTS     3
 
+/* top control struct */
 struct irqtop_ctl {
        int cols;
        int rows;
@@ -78,9 +77,9 @@ struct irqtop_ctl {
        char *hostname;
 
        unsigned int request_exit:1;
-
 };
 
+/* user's input parser */
 static void parse_input(struct irqtop_ctl *ctl, struct irq_output *out, char c)
 {
        switch (c) {
@@ -227,8 +226,6 @@ static void __attribute__((__noreturn__)) usage(void)
 
        fputs(USAGE_OPTIONS, stdout);
        fputs(_(" -d, --delay <secs>   delay updates\n"), stdout);
-       fputs(_("     --once           only display interrupts once, then exit\n"), stdout);
-       fputs(_(" -J  --json           output json, implies displaying once\n"), stdout);
        fputs(_(" -o  --output <list>  define which output columns to use (see below)\n"), stdout);
        fputs(_(" -s, --sort <char>    specify sort criteria by character (see below)\n"), stdout);
        fputs(USAGE_SEPARATOR, stdout);