Find the answer to your Linux question:
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 ...
  1. #1
    Just Joined!
    Join Date
    Feb 2010
    Posts
    21

    Question [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.

  2. #2
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568

    Question

    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
    -------------------

  3. #3
    Linux Guru Rubberman's Avatar
    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!

  4. #4
    Just Joined!
    Join Date
    Feb 2010
    Posts
    21

    Question kernal counters

    Quote Originally Posted by Lakshmipathi View Post
    Can you please explain more about it? .. Counters - do they refer to some kind of performance stuff?
    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.

  5. #5
    Just Joined!
    Join Date
    Feb 2010
    Posts
    21

    Question kernal counters

    Quote Originally Posted by Rubberman View Post
    As Lakshmitpathi asked, what do you mean by "kernel 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.

  6. #6
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568
    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
    -------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...