php Xdebug 跟踪 GUI?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1456395/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 02:39:44  来源:igfitidea点击:

Xdebug trace GUI?

phpuser-interfacetracexdebug

提问by nolanpro

I'm trying to find a GUI to parse and view Xdebug trace files. Although you can make them human readable, the sheer number of lines makes it unusable.

我试图找到一个 GUI 来解析和查看Xdebug 跟踪文件。尽管您可以使它们易于阅读,但行数之多使其无法使用。

I'm looking for something like KCachegrind but for a trace file. My main goal behind all this is to find what the memory hogs are.

我正在寻找类似 KCachegrind 的东西,但需要一个跟踪文件。我在这一切背后的主要目标是找到内存猪是什么。

回答by Bruiser

I found this to be pretty solid. Maybe it's serviceable to you, too:

我发现这非常可靠。也许它也对你有用:

https://github.com/corretge/xdebug-trace-gui

https://github.com/corretge/xdebug-trace-gui

回答by vdrmrt

I found this one: xdebug trace file parser.

我找到了这个:xdebug trace file parser

回答by Ron Inbar

I wrote a simple viewer using .NET WinForms:

我使用 .NET WinForms 编写了一个简单的查看器:

https://github.com/ron-inbar/xdebug-trace-viewer

https://github.com/ron-inbar/xdebug-trace-viewer

You'll need Visual Studio (2010 or later) to build it. Feel free to customize the code.

您将需要 Visual Studio(2010 或更高版本)来构建它。随意自定义代码。

enter image description here

在此处输入图片说明

回答by tungnguyen

You may try Xdebug Trace Explorer. View in Tree-style. I built it after looking around and didn't find any matching solutions. Still not optimize for large file yet:

你可以试试 Xdebug Trace Explorer。以树样式查看。我环顾四周后构建它并没有找到任何匹配的解决方案。仍然没有针对大文件进行优化:

https://github.com/tungbi/xdebug-trace-explorer

https://github.com/tungbi/xdebug-trace-explorer

回答by tungnguyen

I just using started xdebug today came across this problem a few ahours ago too. I'd love a cachegrind style gui for xdebug traces.

我今天刚刚使用了started xdebug,几个小时前也遇到了这个问题。我喜欢用于 xdebug 跟踪的 cachegrind 风格的 gui。

A lot of the lower level calls contain uneccesary information like strlen() calls. I found that xdebug starts the trace file has 21 spaces for top level calls to functions, 23 spaces for second-level calls, 25 and so on. So you can do is grep out lines with more than 22 or more spaces to list top level calls, 24 for sencond and higher level calls etc.

许多较低级别的调用包含非必要信息,例如 strlen() 调用。我发现 xdebug 启动跟踪文件有 21 个空格用于顶级函数调用,23 个空格用于二级调用,25 个等等。所以你可以做的是 grep 出超过 22 个或更多空格的行来列出顶级调用,24 个用于第二个和更高级别的调用等。

cat trace.xt | grep -v '                      '

The web-based trace parser sounds a good idea. It could parse the output into a bunch of nested ul and li elements that could be collapsed. I'm tight for time too, but if you're up for a collaboration lemme know.

基于 Web 的跟踪解析器听起来不错。它可以将输出解析为一堆可以折叠的嵌套 ul 和 li 元素。我的时间也很紧,但如果你想合作,让我知道。

回答by TML

There's a script for vim at xdebug.org that lets you do 'code folding' to make them a little bit easier to dig into, but I've never seen anything that can parse that format into any kind of graphical representation.

xdebug.org 上有一个 vim 脚本,可以让您进行“代码折叠”,使它们更容易深入研究,但我从未见过任何可以将该格式解析为任何类型的图形表示的东西。

回答by XuDing

Shout out to http://derickrethans.nl/xdebug-and-tracing-memory-usage.html. Not a typical GUI, but it does make it easy to view the data.

大喊http://derickrethans.nl/xdebug-and-tracing-memory-usage.html。不是典型的 GUI,但它确实可以轻松查看数据。

回答by Mariano Peterson

WebGrind provides a nice, simple way to view CacheGrind files via a browser:

WebGrind 提供了一种通过浏览器查看 CacheGrind 文件的不错、简单的方法:

But look at XHProf which is open sourced by Facebook, is very easy to setup, captures many important metrics, and even generates call graphs:

但是看看由 Facebook 开源的 XHProf,它非常容易设置,捕获许多重要指标,甚至生成调用图:

回答by catsby

I believe the PDT plugin for Eclipse will import trace logs and I know it can integrate with xdebug and do profiling

我相信 Eclipse 的 PDT 插件会导入跟踪日志,我知道它可以与 xdebug 集成并进行分析

Part 1 of 5 on using PDT and xdebug

关于使用 PDT 和 xdebug 的第 1 部分(共 5 部分)

回答by Sam McAfee

I don't know if this is exactly what you need, but you can enable profiling in XDebug and then dump a big cachegrind file. On my mac, I then used MacCallGrind to view those dumps in a GUI. I can at least see the whole stack of calls for a given request and how much time each call took. Is that what you mean? I haven't got that working in Eclipse PDT yet.

我不知道这是否正是您所需要的,但是您可以在 XDebug 中启用分析,然后转储一个大的 cachegrind 文件。在我的 Mac 上,我使用 MacCallGrind 在 GUI 中查看这些转储。我至少可以看到给定请求的整个调用堆栈以及每个调用花费的时间。你是这个意思吗?我还没有在 Eclipse PDT 中使用它。

http://www.xdebug.org/docs/profiler

http://www.xdebug.org/docs/profiler