How to calculate how many times a function runs???

Hi all:
I have a function in kernel module and I want to see how many times it is called and runs per second. I add a counter in the function so once it runs, counter+=1; is there any timer or something which can check this counter every second???Thanks very much.
Last edited on
Hello,

why don't you create a static local variable which could count the number of calls for this function (by adding its value by one each time) and create another function that when it's called would return this number. You want a function that constantly displays that number? Use a never ending function with say a while(1) loop (I guess there are better ways but I am quite novice to propose something else).
Topic archived. No new replies allowed.