views:

110

answers:

1

I have a bug on my plate to locate and rewrite a static variable in one of our libraries that is taking up launch time in our application. I am not familiar with the library code base and am asking for good heuristics/techniques/grep commands/etc. that would ease my task in identifying the location of said static variable?

(P.S. I'm already searching the code base for static; needless to say it's a verbose result.)

Update: The bug report simply states "library XYZ takes N ms at static initialization"; I do not have any more information about the static variable than that. I don't have the profiling logs but I'll see if I can get them from the bug reporter.

+1  A: 

You could try to do a nm -aC <libname> first and grep by the static and global vars (IIRC they should be prefixed with a B/b or a T/t), then look for those vars in the source code. It may narrow down the haystack a little.

Eugen Constantin Dinca