【问题标题】:Xdebug Profiler creates a cachegrind.out file for auto-prepended file but not the target fileXdebug Profiler 为自动前置文件而不是目标文件创建一个 cachegrind.out 文件
【发布时间】:2014-04-15 21:11:47
【问题描述】:
Looking to profile my web app, I have added the following settings to my Applications php.ini file:


zend_extension                  = "C:\hqp\xampp_1.7.4\php\ext\php_xdebug.dll"
xdebug.profiler_append          = 0
xdebug.profiler_enable          = 1 
xdebug.profiler_output_dir      = "c:\hqp\xampp_1.7.4\tmp\profiles"
xdebug.profiler_output_name     = "cachegrind.out.%s"
xdebug.profiler_enable_trigger  = 1

在 httpd.conf 文件中,使用 php 值 auto_prepend 对文件进行 auto_prepend。生成的cachegrind.out.* 文件带有此文件的名称(xdebug.profiler_output_name 中的 %s 修饰符)而不是我实际要分析的文件(例如 index.php 文件没有对应的 cachegrind.out.filepath_index.php

知道我在这里缺少什么吗?

【问题讨论】:

  • 在 debian 系统上看到与 2.2.1 和 PHP 5.4.4 版本相同的问题
  • 我搬到了 XHProf 顺便说一句...好多了
  • 那又怎样?我这里也有同样的问题...

标签: php profiling xdebug xdebug-profiler


【解决方案1】:

可能您正在生成两个文件,而第二个文件覆盖了第一个文件。

您可以在 php.ini 中更改以下参数:

xdebug.profiler_append=1

这应该将两个调用附加到同一个文件中。 来源:https://xdebug.org/docs/profiler

xdebug.profiler_output_name = cachegrind.out.%u.%p.%r

这应该确保如果有 2 个文件,它们的名称应该不同。

https://xdebug.org/docs/all_settings#trace_output_name 用于其他修饰符。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-07-26
    • 2014-08-09
    • 1970-01-01
    • 2023-03-22
    • 1970-01-01
    • 2013-09-12
    • 1970-01-01
    相关资源
    最近更新 更多