lwfinger / rtl8192ee

Alternate (vendor) driver for RTL8192EE

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Profiling a driver

yavincl opened this issue · comments

Hello, Larry. I have been wondering if it is possible to profile the driver's actions during normal use to know where it spends the most time waiting or doing "nothing". The intent is optimization purposes. However I have never touched this part of driver development and don't have a clue where to start from. Any ideas? Is it even feasible?

All things considered I should start by cleaning up this mess of a source. There is stuff here from a ton of drivers that aren't 8192ee. - it appears to me this would somehow make debugging and profiling more difficult. Mange's 8192eu repo has had a similar clean up - removing stuff that is not needed for 8192eu to build. If you support such a decision of course.

Go for it. As it was not involved in the generated code, and I had no plans on adding it to the kernel, I never wasted time doing the cleanup.

I have been wondering if it is possible to profile the driver's actions during normal use to know where it spends the most time waiting or doing "nothing".

Do you know of any tool or method that fits this purpose? Such as analyzing the time spent in every function, for example. If the solution is to manually add this to the code I'm not really going to bother with it.

There are tools, but not for kernel modules!

You would need to check every #if to see if it could ever be used, and analyse every if(condition) to see if the following code might be executed. It is quite time consuming, thus I never did much of it.

I suppose doing that with this driver would lead to development of completely gray hair within a few days, so i'll just leave it how it is:

# fish shell syntax
$ cat (find) 2>/dev/null | grep -Ea -- 'if \(|elif \(' | wc -l
27768