hotspot icon indicating copy to clipboard operation
hotspot copied to clipboard

Add a "substitute path" option

Open GitMensch opened this issue 1 year ago • 5 comments
trafficstars

Is your feature request related to a problem? Please describe. I currently work on a customer performance check. We have a machine that "nearly matches" what the customer has and get actual quite good results in HotSpot already, but for those we have to setup symlinks to exactly match the paths on the customer machine (thge recording has the full path of the libraries in)

Describe the solution you'd like Provide --substitutePath A:B option for perfparser + hotspot (similar to what GDB offers for source, we can analyze coredumps that way), then later optionally a GUI configuration.

Describe alternatives you've considered What we currently do:

  • add "our" paths to the "extra libraries" and "debug paths" (no clue why, but it seems it needs both) --> but some symbols are still reported as not being foun
  • create the directory structure of the customer (which includes root folders!), then symlink to the paths on the machine -> this currently gives the best results, but is the most work and in this case even needs sudo...

Additional context The substitutePath would be used for both binaries and source mappings.

GitMensch avatar Mar 26 '24 12:03 GitMensch

maybe I misunderstand it, but can't you use a sysroot for that purpose? i.e. just create the mirrored directory structure and then point to that as sysroot?

milianw avatar Apr 12 '24 10:04 milianw

You are right that this works and it also works around the root needing a symlink. I'd say the sysroot option is the perfect workaround (not sure that all parts included source lookup uses that, but at least it should).

But a sysroot needs to be complete, no? If yes than this would mean creating even more symlinks and in any case it is more work (creating the directories, then create the symlinks in there) than just specifying one substitute.

GitMensch avatar Apr 12 '24 10:04 GitMensch

I don't follow. A sysroot needs to be just as complete as your substitute? I mean if you substitute /usr to something else it would also need to include "everything" that the perf.data file accesses.

I'm not saying I don't like the idea of a substitute, but it feels like a super minor thing that you can easily handle with the sysroot already. If you want to work on adding this feature, I'm happy to review patches. But I don't see the need for that myself yet.

milianw avatar Apr 15 '24 09:04 milianw

Sounds fair. I totally agree that this makes no sense for substituting /usr but in this use case there are the two folders /app/folder1 and /opt/DB/ora_client/versionN which would be substituted by something under /opt.

GitMensch avatar Apr 15 '24 10:04 GitMensch

normally you just need /usr from your system so just create a custom "sysroot", symlink that one in, and then add your custom two folders in there and you should be all set?

milianw avatar Apr 15 '24 11:04 milianw