cyrus-and / fracker Goto Github PK
View Code? Open in Web Editor NEWPHP function tracker
PHP function tracker
Hi,
I was using phptrace module for debugging php applications, but I have certains problems with it.
Now I discover your module and is working fine for me on cgi and fpm.
But I miss to know the time that spends each function and file like phptrace does.
Is it possible to add it in further updates?
Here I attach you a comparassion of same code execution in both modules.
Thanks in advance.
macOS
Env
❯ php -version
PHP 7.3.11 (cli) (built: Jun 5 2020 23:50:40) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.11, Copyright (c) 1998-2018 Zend Technologies
with Xdebug v2.7.0, Copyright (c) 2002-2019, by Derick Rethans
~/Downloads/fracker/ext master Py anaconda2 19:36:08
❯ ~/php-private/phpize
Configuring for:
PHP Api Version: 20180731
Zend Module Api No: 20180731
Zend Extension Api No: 320180731
Error after i exec make
/Users/zeroyu/Downloads/fracker/ext/src/tracing/trace_fracker.c:91:20: error: use of undeclared identifier
'SOL_TCP'
setsockopt(fd, SOL_TCP, TCP_CORK, &cork, sizeof(cork));
^
/Users/zeroyu/Downloads/fracker/ext/src/tracing/trace_fracker.c:91:29: error: use of undeclared identifier
'TCP_CORK'
setsockopt(fd, SOL_TCP, TCP_CORK, &cork, sizeof(cork));
^
/Users/zeroyu/Downloads/fracker/ext/src/tracing/trace_fracker.c:101:20: error: use of undeclared identifier
'SOL_TCP'
setsockopt(fd, SOL_TCP, TCP_CORK, &cork, sizeof(cork));
^
/Users/zeroyu/Downloads/fracker/ext/src/tracing/trace_fracker.c:101:29: error: use of undeclared identifier
'TCP_CORK'
setsockopt(fd, SOL_TCP, TCP_CORK, &cork, sizeof(cork));
^
4 errors generated.
make: *** [src/tracing/trace_fracker.lo] Error 1
Xdebug has fixed a bug recently:
Fixed bug #1734: Segfault with DBGp "source" with a out-of-range start line number
And this is what I'm getting in my computer:
[ 5633.102448] php-fpm[17184]: segfault at 31 ip 00007fe72f9eb815 sp 00007ffc8091ce30 error 4 in xdebug.so[7fe72f9b8000+44000]
Perhaps it's something you should consider fixing.
Thanks
Typo in message when shutting down
I suggest adding a flag to show when a certain file:line is reached, ex.
$ fracker -l 1.php:23
...
Reached line 1.php:23
...
Another useful feature would be a flag to print every PHP line executed (similar to python -m trace 1.py
).
This could be very useful for collecting coverage data and debugging complex branching logic inside a single function (ex. parsers).
If we take this idea further, executing custom PHP code when a breakpoint / function call / return is reached would be amazing.
$ phpize
$ ./configure
$ make
The make
command results in:
fracker/ext/xdebug_trace_fracker.c:17:10: fatal error: json.h: No such file or directory
#include <json.h>
^~~~~~~~
compilation terminated.
make: *** [Makefile:270: xdebug_trace_fracker.lo] Error 1
EDIT: Running it on a fresh install of Ubuntu19+php7.2+Apache.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.