> 运行结果 xdebug的输出文件格式(cachegrind.out) xdebug的输出文件格式(cachegrind.out) xdebug的性能测试输出文件名是可以配置的。 默认是 xdebug.profiler_output_name = cachegrind.out.%p 那个%p是服务器的pid,会输出“cachegrind.out.1408”之类的文件。 %r trace.072db0.xt %s 脚本文件名(注) cachegrind.out.%s cachegrind.out. 那么我可以用: xdebug.profiler_output_name = cachegrind.out. %s 多个域名的话,也可以组合使用 xdebug.profiler_output_name = cachegrind.out.%H.%u.
3.Cachegrind Cache分析器,它模拟CPU中的一级缓存I1,DI和二级缓存,能够精确的指出程序中cache的丢失和命中。 3.再来试试cachegrind: ? 上面是指令缓存,I1和L2i缓存的访问信息,包括总的访问次数,丢失次数,丢失率。 中间是数据缓存,D1和L2d缓存的访问相关信息。 下面是L2缓存单独的信息。 也有一个输出文件,cachegrind.out.25843,可以用cg_annotate 来查看。显示出详细的列表。 4.missif的使用 跟cachegrind类似,只不过生成的文件不一样,生成的是massif.pid.ps的PostScript文件,里面只有一副描述堆栈使用情况的彩图。
xdebug应该已经在我们配置的分析文件保存目录产生了文件, 类似 % ll /var/tmp/xdebug -rw-r--r-- 1 user group 48K 4 29 13:40 cachegrind.out 也可以在命令后直接跟要分析的文 qcachegrind /var/tmp/xdebug/cachegrind.out.37947 使用webgrind 下载: https://github.com/jokkedk
展示成图表的形式 在php.ini中增加如下配置: xdebug.profiler_output_dir=/tmp xdebug.profiler_enable=1 访问程序后 , 会在tmp目录生成cachegrind.out.xxxx
Cachegrind是一个缓存和分支预测探查器。它可以帮助您使程序运行更快。 Callgrind是一个生成调用图的缓存分析器。 它与Cachegrind有一些重叠,但也收集了Cachegrind没有的一些信息。 Helgrind是线程错误检测器。它可以帮助您使多线程程序更正确。 DRD还是线程错误检测器。 Valgrind是一个工具集,包括Memcheck、Cachegrind、Callgrind等多个工具。memcheck是默认项。 valgrind .
off xdebug.profiler_enable = off xdebug.profiler_enable_trigger = Off xdebug.profiler_output_name = cachegrind.out
Callgrind :生成可视化图形界面,收集程序运行时的一些数据,建立函数调用关系图,gprof2dot.py Cachegrind:分析CPU的cache命中率、丢失率,用于进行代码优化。
xdebug" ;打开xdebug的性能分析器,以文件形式存储,这项配置是不能以ini_set()函数配置的,默认值为0 xdebug.profiler_enable = 1 ;性能分析文件的命名规则,默认值为cachegrind.out %p xdebug.profiler_output_name = "cachegrind.out.%t.
xdebug.remote_enable = 1 xdebug.profiler_enable = 1 xdebug.profiler_enable_trigger = 1 xdebug.profiler_output_name = cachegrind.out
xdebug.profiler_enable = off xdebug.profiler_enable_trigger = off xdebug.profiler_output_name = cachegrind.out
xdebug.trace_output_dir="D:/debug" ;指定性能分析文件的存放目录 xdebug.profiler_output_dir="D:/debug" xdebug.profiler_output_name = "cachegrind.out
它会生成cachegrind文件,并可用KCacheGrind或QCacheGrind可视化分析。配置Xdebug性能分析:安装Xdebug。 展开代码语言:IniAI代码解释xdebug.profiler_enable=1xdebug.profiler_output_dir="/var/tmp/xdebug_profiles"运行应用,生成cachegrind
Cachegrind。它主要用来检查程序中缓存使用出现的问题。 Helgrind。它主要用来检查多线程程序中出现的竞争问题。 Massif。它主要用来检查程序中堆栈使用中出现的问题。
函数配置的,默认值为0 xdebug.profiler_output_dir 性能分析文件的存放位置,默认值为/tmp xdebug.profiler_output_name 性能分析文件的命名规则,默认值为cachegrind.out
目录生成文件 # chown nobody:nobody /tmp/xdebug 正常的运行PHP会生成调试文件 -rw-r--r-- 1 nobody nobody 5758239 Oct 27 14:56 cachegrind.out http://book.51cto.com/art/200906/126516.htm KCacheGrind windows 系統下的代替方案 WinCacheGrind 可分析由xdebug產出的cachegrind.xxx
IO栈 11、blkstrace iosnoop快IO跟踪 strace gdb dtrace 12、系统级别和进程级别的工具:oprofile perf DTrace SystemTap cachegrind
2.Cachegrind:缓存分析组件,检测缓存丢失和命中等信息。 3.Callgrind:函数调用分析组件,检测程序的运行时间和调用过程。 4.Massif:堆分析组件,检测程序使用了多少堆内存。 your-prog [your-prog-options] 通用的选项: --tool=<toolname> [default: memcheck] #选择需要使用的Valgrind组件,例如例如 memcheck、cachegrind
Cachegrind:用于缓存和分支预测器性能分析的工具。可以使用valgrind --tool=cachegrind <程序>来运行。Callgrind:用于函数调用关系的性能分析工具。
xdebug.profiler_output_name 类型:字符串 默认值:cachegrind.out%p 这个设置决定了转储跟踪写入的文件的名称。 如果你执行某段程 序后,再打开相应的目录,可以发现生成了一堆文件,例如cachegrind.out.1169585776这种格式命名的文件。这些就是Xdebug生 成的分析文件。
其内的 cachegrind工具允许用户进行缓存仿真,并用缓存缺失的数量对源代码进行注释。 hostnamectl ==2833== Cachegrind, a cache and branch-prediction profiler ==2833== Copyright (C) 2002 通过cg_annotate工具对cachegrind.out.2833文件进行注解的结果,它提供了详细的缓存分析。 ┌──[root@liruilongs.github.io]-[~] └─$cg_annotate cachegrind.out.2833 ------------------------------ 继续分析一下注解文件 ┌──[root@liruilongs.github.io]-[~] └─$cg_annotate cachegrind.out.6512 ------------------