xperf 无法加载我的 DLL 符号

发布于 2024-08-31 02:27:41 字数 337 浏览 1 评论 0原文

我正在尝试使用 xperf 来分析我的 DLL,但它拒绝使用我的 DLL 的 PDB 文件。 使用 -symbols 在 .etl 上运行 xperf,我得到:

DBGHELP: mydll- private symbols & lines
         C:\mydll\debugu\mydll.pdb - unmatched

这让我相信它认为我的 PDB 与应用程序正在使用的 DLL 不匹配。这是错误的;它确实匹配。我已经使用 procexp 确认了应用程序链接的 DLL 的路径,完全重建了项目,等等。它仍然认为不匹配。

关于可能出什么问题的任何想法吗?

I'm trying to use xperf to profile my DLL, but it refuses to use my DLL's PDB file.
Running xperf on the .etl with -symbols, I get:

DBGHELP: mydll- private symbols & lines
         C:\mydll\debugu\mydll.pdb - unmatched

Which leads me to believe it thinks my PDB doesn't match the DLL the application is using. This is wrong; it does match. I've confirmed the path of the DLL the application is linking with using procexp, completely rebuilt the project, and so on. It still thinks it doesn't match.

Any ideas on what could be wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

时光是把杀猪刀 2024-09-07 02:27:41

尝试设置系统环境变量 _NT_SYMBOL_PATH 以指向 .pdb 文件 _NT_SYMCACHE_PATH 以指向 c:\Symbols。请参阅 http://msdn 上有关 XPerf 符号处理的文档.microsoft.com/en-us/library/ff191023(VS.85).aspx

WindowsItPro dot com 上还有一篇不错的博客文章,标题为“Under the covers with XPerf”,其中介绍了 XPerf 中的符号处理。

请注意,我需要使用正确的值设置系统环境变量,xperfview 没有选择批处理文件中的环境设置(启动 XPerfView 后立即检查“跟踪”、“配置符号路径”菜单选项)

Try setting a SYSTEM environment variable _NT_SYMBOL_PATH to point to your .pdb file _NT_SYMCACHE_PATH to point to c:\Symbols. See the docs on XPerf symbol handling at http://msdn.microsoft.com/en-us/library/ff191023(VS.85).aspx

There is also a good blog article titled "Under the covers with XPerf" on WindowsItPro dot com that covers symbol handing in XPerf.

Note that I needed to set a system environment variable with the correct values, setting the environment in a batch file was not picked up by xperfview (check Trace, Configure Symbol Path menu option immediately after starting XPerfView)

我乃一代侩神 2024-09-07 02:27:41

抱歉,我问过这个问题,然后忘记了。

实际上有两个问题。

第一个是 xperf 实际上使用了我的符号的旧缓存版本。通过从符号缓存中删除它来修复此问题。

第二个是当我在 xperfview 中加载符号时,它实际上并没有将我最新的 pdb 放入符号缓存中。然而,pdb 位于我确认包含在 _NT_SYMBOL_PATH 变量中的目录中。不幸的是,我不记得用于修复此问题的确切命令,但我相信它是“xperf file.etl -symbols”变体。该命令正确解析了 etl 并加载/缓存了遇到的所有相关符号。之后,xperfview 可以正确显示我的符号。

请注意,每当我的 pdb 发生更改时,我都必须重新运行该命令,因为 xperfview 仍然不会触及符号缓存中尚未存在的任何内容。我仍然不确定为什么它在我的机器上表现如此,其他人似乎没有这个问题。

Sorry, I asked this question and forgot about it.

There were actually two problems.

The first is that xperf was actually using an older cached version of my symbols. This was fixed by deleting it from the symbol cache.

The second was that when I loaded symbols in xperfview, it didn't actually put my up-to-date pdb into the symbols cache. The pdb was in a directory that I confirmed was included in the _NT_SYMBOL_PATH variable, however. Unfortunately, I don't remember the exact command used to fix this, but I believe it was an 'xperf file.etl -symbols' variant. This command correctly parsed the etl and loaded/cached all of the relevant symbols as it encountered them. After this, xperfview could correctly show my symbols.

Note that I had to re-run the command any time my pdb changed, because xperfview still wouldn't touch anything that wasn't already in the symbol cache. I'm still not sure why it behaves this way on my machine, other people don't seem to have this problem.

娇纵 2024-09-07 02:27:41

我刚刚在 SO 上发布了一个类似问题的答案,该问题可能与此处遇到的问题有关......

基本上,如果DLL 是动态加载的,它可能会给 XPerf 带来符号加载方面的麻烦。

就我个人而言,我猜测这是关于 XPerf 中的逻辑决定是否尝试为给定模块加载符号。例如“加载所有 EXE 及其 IAT 条目”(这将跳过所有动态 DLL - 似乎并非如此,但类似的情况正在发生)

编辑:

我最近与一位同事讨论了这一点,并了解到 XPerf 将正确“决定”加载以编程方式加载的 DLL 的符号...如果 DLL 保持加载状态直到进程终止。

因此,对于在执行期间加载和卸载以及在终止时卸载的 DLL...XPerf 将跳过加载这些符号的尝试。

I just posted an answer to a similar question on SO that could be related to the problem experienced here...

Basically, if the DLL is dynamically loaded, it can cause trouble for XPerf with regard to symbol loading.

Personally, I am guessing it is about logic within XPerf deciding whether to even try to load symbols for a given module. e.g. "load all EXE's and their IAT entries" (which would skip all dynamic DLL's - which doesn't appear to be the case, but something similar is going on)

EDIT:

I recently discussed this with a collegue, and learned that XPerf will properly "decide" to load symbols for DLLs loaded programmatically ... IF the DLL remains loaded until the termination of the process.

So, for DLLs that are Loaded and Unloaded during the execution, and are unloaded at termination... XPerf will skip the attempt to load those symbols.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文