Results 1 to 6 of 6
HI..
I want to clear kernel counters. i dont know how to do that,as i am new to linux.Is there any standard function in linux for clearing kernel counters? if ...
- 03-31-2010 #1Just Joined!
- Join Date
- Feb 2010
- Posts
- 21
[SOLVED] how to clear kernel counters
HI..
I want to clear kernel counters. i dont know how to do that,as i am new to linux.Is there any standard function in linux for clearing kernel counters? if so please tell me.
- 03-31-2010 #2
Can you please explain more about it? .. Counters - do they refer to some kind of performance stuff?
Last edited by Lakshmipathi; 03-31-2010 at 02:47 PM. Reason: typo
- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 04-01-2010 #3Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
As Lakshmitpathi asked, what do you mean by "kernel counters"?
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 04-01-2010 #4Just Joined!
- Join Date
- Feb 2010
- Posts
- 21
kernal counters
hi..
I was analyzing a phy driver . In that they have cleared the kernel counters by calling some function . i dono whether it is standard function used for clearing the counters.
(void) fetch_stats(dev,NULL,1);
static int fetch_stats(struct atm_dev *dev,struct sonet_stats *arg,int zero)
{
struct sonet_stats tmp;
int error = 0;
sonet_copy_stats(&PRIV(dev)->sonet_stats,&tmp);
if (arg) error = copy_to_user(arg,&tmp,sizeof(tmp));
if (zero && !error) sonet_subtract_stats(&PRIV(dev)->sonet_stats,&tmp);
return error ? -EFAULT : 0;
this is the function they are using to clear the counters. i just want to know what
basically this function do in kernel.
- 04-01-2010 #5Just Joined!
- Join Date
- Feb 2010
- Posts
- 21
kernal counters
hi..
I was analyzing a phy driver . In that they have cleared the kernel counters by calling some function . i dono whether it is standard function used for clearing the counters.
(void) fetch_stats(dev,NULL,1);
static int fetch_stats(struct atm_dev *dev,struct sonet_stats *arg,int zero)
{
struct sonet_stats tmp;
int error = 0;
sonet_copy_stats(&PRIV(dev)->sonet_stats,&tmp);
if (arg) error = copy_to_user(arg,&tmp,sizeof(tmp));
if (zero && !error) sonet_subtract_stats(&PRIV(dev)->sonet_stats,&tmp);
return error ? -EFAULT : 0;
}
this is the function they are using to clear the counters. i just want to know what
basically this function do in kernel.
- 04-01-2010 #6
I don't have experience in device driver programming. I found this
LXR / The Linux Cross Reference
Hope this helps in your src code analysis.
ps: something like Doxygen tool might be helpful too.
HTH- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------



