From 5e67d9ebf4cfb76f359ea25ad425de81f80700cc Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 30 Aug 2013 11:24:30 +0200 Subject: ifpps: Skip reading IRQ number from /proc/interrupts We don't use the IRQ number we read from /proc/interrupts, so just skip it while reading. This also allows us to drop the irq_nr member from struct ifstat. Signed-off-by: Tobias Klauser --- ifpps.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'ifpps.c') diff --git a/ifpps.c b/ifpps.c index 1a67551..b45b05f 100644 --- a/ifpps.c +++ b/ifpps.c @@ -45,7 +45,7 @@ struct ifstat { long long unsigned int tx_fifo, tx_colls, tx_carrier; uint64_t mem_free, mem_total, mem_active, mem_inactive; uint64_t swap_total, swap_free, swap_cached; - uint32_t irq_nr, procs_total, procs_run, procs_iow, cswitch; + uint32_t procs_total, procs_run, procs_iow, cswitch; struct wifi_stat wifi; /* * Pointer members need to be last in order for stats_zero() to work @@ -280,17 +280,15 @@ retry: while (fgets(buff, buff_len, fp) != NULL) { buff[buff_len - 1] = 0; - ptr = buff; if (strstr(buff, ifname) == NULL) continue; - /* XXX: remove this one here */ - stats->irq_nr = strtol(ptr, &ptr, 10); - bug_on(stats->irq_nr == 0); + ptr = strchr(buff, ':'); + if (!ptr) + continue; + ptr++; - if (ptr) - ptr++; for (i = 0; i < cpus && ptr; ++i) { if (seen) stats->irqs[i] += strtol(ptr, &ptr, 10); -- cgit v1.2.3-54-g00ecf