• Alessandro Rubini's avatar
    kernel/wr_pstats: support "zeroing" of counters. · 5238b9d4
    Alessandro Rubini authored
    By writing anything to a port file, you zero the counters for that
    port. By writing to "info" or "description" you zero counters for
    all ports.
    
    Zeroing is performed by copying the current values to a new array,
    and always subytracting that array to the current counter values.
    
    No zeroing is performed for network statistics, that still reads
    the "real" counters, featuring an overflow at 4G but no zeroing ever.
    
    To simplify a little the code, I turned the one-dimensional array
    with index arithmetics into a two-dimensional array, so the compiler
    makes the math for us, transparently.
    
    NOTE: the spinlock must be audited, we are not safe yet, not only
    because of this patch.
    Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
    5238b9d4
Name
Last commit
Last update
..
at91_softpwm Loading commit data...
wbgen-regs Loading commit data...
wr_clocksource Loading commit data...
wr_nic Loading commit data...
wr_pstats Loading commit data...
wr_rtu Loading commit data...
wr_vic Loading commit data...
Makefile Loading commit data...