summaryrefslogtreecommitdiff
path: root/ifpps.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2013-08-30 11:24:30 +0200
committerTobias Klauser <tklauser@distanz.ch>2013-08-30 11:24:30 +0200
commit5e67d9ebf4cfb76f359ea25ad425de81f80700cc (patch)
tree8f81cf1d3a35f8c9a055e33a96d07d3844a4c49b /ifpps.c
parent2f48dd150e51c3e4c962c0c050ee316d2e25bccb (diff)
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 <tklauser@distanz.ch>
Diffstat (limited to 'ifpps.c')
-rw-r--r--ifpps.c12
1 files changed, 5 insertions, 7 deletions
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);