Condividi tramite


Use Symbol Filtering to get symbols you care about from your server instead of getting the kitchen sink

One of the most annoying things about working with performance traces is that they include information about everything in the system.  That's also one of the great things.

However, most of the time, for most problems, there are very few things you are specifically looking for.  Like in my case I'm looking at IE problems and I already know all the IE dlls.  If the dude happens to have 82 other programs running and idle I do not need to download their symbols.  There is no easy way to specify the symbols I care about so I wrote this local symbol proxy.  Beware it's slightly cheesy but it's super helpful because you neither have to download or cache symbols you don't care about.  I haven't tested it extensively but it works for me.  If you find bugs, maybe you can stick it on a github somewhere and start maintaining it for reals.  I feel like I've done my part :)

The source code is here.

As usual it comes with no warrantee and no rights are implied etc.  It's just a quick sample I threw together.

To use it, create your own symfilter.txt file with one pattern on each line.  It expects to find in the current directory when you start it.  Then run the thing.  Any requests that do not contain your strings will get a 404 return.  Everything else will be forwarded to the indicated server for resolution.

If your server path used to be

_NT_SYMBOL_PATH=srv*https://someserver/somepath

change it to

_NT_SYMBOL_PATH=srv*https://localhost:8080/someserver|somepath

The bit before the | is used to find the actual server, the request will be changed to be https://someserver/somepath/...whatever

You could imagine having several configuration files listening on several ports but I leave that as an exercise to the reader.  This thing saves me a ton of time by not fetching symbols I don't need.

Enjoy :)

from your server

Comments

  • Anonymous
    December 08, 2014
    Nice. You could also use Fiddler Core. It's not as fun to write, but supports a lot of options and extra scripting. www.telerik.com/.../fiddlercore

  • Anonymous
    December 08, 2014
    Actually Justin suggested it but I was mostly done by then :)

  • Anonymous
    December 08, 2014
    Another option would be to create a symsrv.ini file. msdn.microsoft.com/.../ms681416(v=vs.85).aspx

  • Anonymous
    December 09, 2014
    The comment has been removed

  • Anonymous
    December 09, 2014
    What I'd really like to see is _NT_SYMBOL_INCLUDE=x*;y*;z*  and _NT_SYMBOL_EXCLUDE=a*;b;c;etc That seems super easy to do in the base leaving the server out of it.  Because really it's a context specific decision.  That's why I designed my thing to run local, so you can change it at whim.

  • Anonymous
    December 09, 2014
    The comment has been removed

  • Anonymous
    December 10, 2014
    All native Images *.ni.pdb should be excluded by default since they will never be on any symbol server but take a lot of time if you are working with a large Ngenned code base.

  • Anonymous
    January 05, 2015
    Hey, FiddlerCore is lots of fun to program in! :-) It'll also properly handle things like redirects, and chunked encoding. The Return404 function should have a Content-Length: 0 header to allow for proper connection reuse.

  • Anonymous
    January 05, 2015
    The comment has been removed