• 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
binaries Loading commit data...
build Loading commit data...
configs Loading commit data...
doc Loading commit data...
hwinfo-sdb Loading commit data...
kernel Loading commit data...
patches Loading commit data...
robustness/coding Loading commit data...
scripts Loading commit data...
usb-loader Loading commit data...
userspace Loading commit data...
.gitignore Loading commit data...
.gitmodules Loading commit data...
COPYING Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...
Makefile.kconfig Loading commit data...
README Loading commit data...