microsoft / perfview

PerfView is a CPU and memory performance-analysis tool
http://channel9.msdn.com/Series/PerfView-Tutorial
MIT License
4.09k stars 696 forks source link

[TraceEvent] Make SymbolReader extendable for custom symbol formats #1282

Open MBulli opened 3 years ago

MBulli commented 3 years ago

I'm using the TraceEvent library to process events emitted from Delphi code. Sadly the Delphi compiler does not generate pdb files, but some other file formats, e.g. ASCII based *.map files. Hence, my callstacks can't be symbolized with TraceEvent. Clearly, I could implement the symbol lookup code by myself (this is what I'm going to do), but it would be nice if the library could handle other symbol file formats beside pdb as well.

I understand that the focus is on the MS ecosystem but it would be a nice enhancement to the library if the SymbolReader API would be a open to custom implementations.

rauhs commented 3 years ago

@MBulli Do you have the symbol lookup implemented for Delphi Map files? We're a company with a mixed application and would love to be able to resolve delphi symbols.

MBulli commented 3 years ago

Sadly no. I was able to produce an almost valid pdb file based on the map file. WinDbg was able to verify the pdb, however the symbol lookup did not work. I didn't even try TraceEvent. As far as i remember important information was missing in the map file. I did not try to extend the TraceEvent library, I think because it seemed quite hard to do.

I then switched over to rsm files and started to write a dcu parser based on the amazing DCU32INT utility by Alexei Hmelnov. His dcu parser is very complete but confusing at first. In order to better unterstand the dcu format I decided to rewrite his code and use this as a basis for a pdb generator.

This is still an ongoing process because I'm doing it in my spare time for fun :)

MBulli commented 3 years ago

@rauhs I found this code here: https://bitbucket.org/sglienke/map2pdb/src/master/

It does the same thing I tried to do with map files and pdb but seems to succeeded with it, though I didn‘t try it yet.