+#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,
#define DEF_SORT_FUNC ((sort_fp *)sort_total)
+/* output definition */
struct irq_output {
int columns[__COL_COUNT * 2];
size_t ncolumns;
struct libscols_table *get_scols_table(struct irq_output *out,
struct irq_stat *prev,
struct irq_stat **xstat);
+
+#endif /* UTIL_LINUX_H_IRQ_COMMON */
#include <libsmartcols.h>
-#include "c.h"
#include "closestream.h"
#include "monotonic.h"
-#include "nls.h"
#include "pathnames.h"
#include "strutils.h"
#include "timeutils.h"
#define MAX_EVENTS 3
+/* top control struct */
struct irqtop_ctl {
int cols;
int rows;
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) {
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);