#!/usr/bin/perl # do math diff's on interrupt: # 12: 1213 INTC DMA # 86: 565 INTC TIWLAN_SDIO #309: 23616 GPIO tiwlan0 $oldfile = shift || "/tmp/old"; $newfile = shift || "/tmp/new"; @old = `cat $oldfile`; # open wide... @new = `cat $newfile`; # open wide... $cntr = 0; `cat /proc/interrupts | egrep -i "wlan|dma" > /tmp/old`; `ls -al / > /dev/null`; `sync`; `cat /proc/interrupts | egrep -i "wlan|dma" > /tmp/new`; foreach (@new) { # print; /^( *\d+): *(\d+)(.*)$/; $new_int_no = $1; $new_quan = $2; $new_name = $3; $_ = $old[$cntr]; # get old one /^( *\d+): *(\d+)(.*)$/; $old_int_no = $1; $old_quan = $2; $old_name = $3; if ($new_int_no eq $old_int_no) { printf ("$new_int_no: diff: %d $new_name\n", $new_quan - $old_quan); } $cntr++; }