From: Thomas Graf Date: Sat, 13 Nov 2004 15:15:05 +0000 Subject: Re: [LARTC] Reset Statistics? Message-Id: <20041113151505.GX31969@postel.suug.ch> List-Id: References: <41924B7F.3050202@anduras.de> In-Reply-To: <41924B7F.3050202@anduras.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org * Sven Anders <41924B7F.3050202@anduras.de> 2004-11-10 18:10 > Is it possible to reset the statistics (ip -s link) ?? > > If not, why. Maybe there is a trick? The statistics are stored in the driver but you can write a kernel module calling get_stats for each netdevice and set them to 0. struct net_device *dev; rtnl_lock(); read_lock(&dev_base_lock); for (dev = dev_base; dev; dev = dev->next) { struct net_device_stats *s = dev->get_stats(); memset(s, 0, sizeof(*s)); } read_unlock(&dev_base_lock); rtnl_unlock(); Both, dev_base and dev_base_lock are exported symbols. Not tested but might work. _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/