How to monitor the real time kernel buffer utilization
I want to monitor the real time utilization of a kernel module buffer, while running some benchmark. But when I did it through adding some "printk(...)", I found the performance of benchmark will be seriously injured, which in turn cannot reflect the exact real time buffer utilization. So, how can I achieve this? I mean, monitor the buffer utilization while not injuring the performance of the running benchmark, or just a little performance injury that can be neglected.
Thank you! |
A routine like "printk" would indeed be very "phat" (fat...).
Usually, the best way I've found to do metrics like this is to set some kind of a rule, then use a very simple yes/no counting mechanism to observe how often the rule was or was-not broken. When the counter values grow large, do a logical right-shift (divide by two) on all of them at once so that they never overflow. This approach is one of giving you the answer that you really care about: "am I running out of room?" Or, "am I possibly losing data to a buffer overrun?" And, it doesn't give you a flood of data to "analyze." Find out "what hurts," e.g. running out of buffers. Then, set up some kind of test ... "90% of the time I wont run out." Yes or no. Pass or fail. This is often much easier than gathering some huge data stream and trying to "analyze" it. |
All times are GMT -5. The time now is 10:27 AM. |