A tracing and troubleshooting tool for PHP scripts.

Overview

phptrace

We have a new trace tool Molten, It's an OpenTracing supported tracer, for Distributed Tracing System.

我们开发了新的Trace工具 Molten, 它支持OpenTracing,用于分布式追踪系统。

Build Status

Readme in Chinese 中文

phptrace is a low-overhead tracing tool for PHP.

It can trace all PHP executing, function calls, request information during run-time. And provides features like Filter, Statistics, Current Status and so on.

It is very useful to locate blocking, heavy-load problems and debug in all environments, especially in production environments.

Features:

  • low-overhead, when extension loaded and trace is off
  • stable, running on Qihoo 360 and tested on mainstream frameworks
  • ease of use, view PHP run-time status without extension installation

Misc:

News We have build another interesting project pika. It's a NoSQL compatible with Redis protocol with huge storage space.

Install from source

  1. Extracting tarball

    tar -xf phptrace-{version}.tar.gz
    cd phptrace-{version}/extension
    
  2. Build

    PHP Extension

    {php_bin_dir}/phpize
    ./configure --with-php-config={php_bin_dir}/php-config
    make
    

    CLI Binary

    make cli
    
  3. Install & Configure

    Install PHP Extension, CLI Binary into PHP path

    make install-all
    

    Edit php.ini, add the following line. A reload is needed if PHP running on php-fpm mode.

    extension=trace.so
    
  4. Verify

    php -r 'for ($i = 0; $i < 20; $i++) usleep(50000);' &
    phptrace -p $!
    

    You should see something below if it works fine

    process attached
    [pid 3600]> cli php -
    [pid 3600]> {main}() called at [Command line code:1]
    [pid 3600]    > usleep(50000) called at [Command line code:1]
    [pid 3600]    < usleep(50000) = NULL called at [Command line code:1] ~ 0.051s 0.051s
    [pid 3600]    > usleep(50000) called at [Command line code:1]
    [pid 3600]    < usleep(50000) = NULL called at [Command line code:1] ~ 0.051s 0.051s
    [pid 3600]    > usleep(50000) called at [Command line code:1]
    [pid 3600]    < usleep(50000) = NULL called at [Command line code:1] ~ 0.051s 0.051s
    [pid 3600]    > usleep(50000) called at [Command line code:1]
    ...
    

Usage

Just try php example.php.

Command line options

  • trace trace running php process(default)
  • status display php process status
  • version show version
  • -p specify php process id ('all' to trace all processes)
  • -h show helper
  • -v same as version
  • -f filter data by type(url,function,class) and content
  • -l limit output count
  • --ptrace in status mode fetch data using ptrace

Trace executing

say("good night") = NULL called at [example.php:33] ~ 0.000s 0.000s [pid 3600] > Me->sleep() called at [example.php:34] [pid 3600] > Me->say("sleeping...") called at [example.php:27] [pid 3600] < Me->say("sleeping...") = NULL called at [example.php:27] ~ 0.000s 0.000s [pid 3600] > sleep(2) called at [example.php:28] [pid 3600] < sleep(2) = 0 called at [example.php:28] ~ 2.000s 2.000s [pid 3600] < Me->sleep() = NULL called at [example.php:34] ~ 2.000s 0.000s [pid 3600] > Me->say("wake up") called at [example.php:35] [pid 3600] < Me->say("wake up") = NULL called at [example.php:35] ~ 0.000s 0.000s [pid 3600] < Me->run() = NULL called at [example.php:57] ~ 2.000s 0.000s">
$ phptrace -p 3600

[pid 3600]    > Me->run() called at [example.php:57]
[pid 3600]        > Me->say("good night") called at [example.php:33]
[pid 3600]        < Me->say("good night") = NULL called at [example.php:33] ~ 0.000s 0.000s
[pid 3600]        > Me->sleep() called at [example.php:34]
[pid 3600]            > Me->say("sleeping...") called at [example.php:27]
[pid 3600]            < Me->say("sleeping...") = NULL called at [example.php:27] ~ 0.000s 0.000s
[pid 3600]            > sleep(2) called at [example.php:28]
[pid 3600]            < sleep(2) = 0 called at [example.php:28] ~ 2.000s 2.000s
[pid 3600]        < Me->sleep() = NULL called at [example.php:34] ~ 2.000s 0.000s
[pid 3600]        > Me->say("wake up") called at [example.php:35]
[pid 3600]        < Me->say("wake up") = NULL called at [example.php:35] ~ 0.000s 0.000s
[pid 3600]    < Me->run() = NULL called at [example.php:57] ~ 2.000s 0.000s

Print current status

$ phptrace status -p 3600

------------------------------- Status --------------------------------
PHP Version:       7.0.16
SAPI:              cli
script:            example.php
elapse:            26.958s
------------------------------ Arguments ------------------------------
$0
------------------------------ Backtrace ------------------------------
#0  fgets() called at [example.php:53]
#1  {main}() called at [example.php:53]

Tracing with filter of url/class/function

say("good night") = NULL called at [example.php:33] ~ 0.000s 0.000s [pid 3600]> Me->sleep() called at [example.php:34] [pid 3600]> Me->say("sleeping...") called at [example.php:27] [pid 3600]< Me->say("sleeping...") = NULL called at [example.php:27] ~ 0.000s 0.000s [pid 3600]< Me->sleep() = NULL called at [example.php:34] ~ 2.000s 2.000s [pid 3600]> Me->say("wake up") called at [example.php:35] [pid 3600]< Me->say("wake up") = NULL called at [example.php:35] ~ 0.000s 0.000s [pid 3600]< Me->run() = NULL called at [example.php:57] ~ 2.001s 0.000s">
$ phptrace -p 3600 -f type=class,content=Me

[pid 3600]> Me->run() called at [example.php:57]
[pid 3600]> Me->say("good night") called at [example.php:33]
[pid 3600]< Me->say("good night") = NULL called at [example.php:33] ~ 0.000s 0.000s
[pid 3600]> Me->sleep() called at [example.php:34]
[pid 3600]> Me->say("sleeping...") called at [example.php:27]
[pid 3600]< Me->say("sleeping...") = NULL called at [example.php:27] ~ 0.000s 0.000s
[pid 3600]< Me->sleep() = NULL called at [example.php:34] ~ 2.000s 2.000s
[pid 3600]> Me->say("wake up") called at [example.php:35]
[pid 3600]< Me->say("wake up") = NULL called at [example.php:35] ~ 0.000s 0.000s
[pid 3600]< Me->run() = NULL called at [example.php:57] ~ 2.001s 0.000s

Limit frame/URL display times

say("good night") = NULL called at [example.php:33] ~ 0.000s 0.000s [pid 3600] > Me->sleep() called at [example.php:34] [pid 3600] > Me->say("sleeping...") called at [example.php:27] [pid 3600] < Me->say("sleeping...") = NULL called at [example.php:27] ~ 0.000s 0.000s">
$ phptrace -p 3600 -l 2

[pid 3600]    > Me->run() called at [example.php:57]
[pid 3600]        > Me->say("good night") called at [example.php:33]
[pid 3600]        < Me->say("good night") = NULL called at [example.php:33] ~ 0.000s 0.000s
[pid 3600]        > Me->sleep() called at [example.php:34]
[pid 3600]            > Me->say("sleeping...") called at [example.php:27]
[pid 3600]            < Me->say("sleeping...") = NULL called at [example.php:27] ~ 0.000s 0.000s

Contributing

Welcome developers who willing to make PHP environment better.

If you are interested but have no idea about how to starting, please try these below:

License

This project is released under the Apache 2.0 License.

Comments
  • mac 编译cmdtool 报错

    mac 编译cmdtool 报错

    机器:mac air php: 5.6.3 cd 到 cmdtool 目录 make 报如下错误 gcc -g -Wall -O2 -fno-strict-aliasing -D_GNU_SOURCE -I/Users/xxx/work/study/php/phptrace-master/cmdtool/../common -I/Users/xxx/work/study/php/phptrace-master/cmdtool/../common/sds -c sys_trace.c -o sys_trace.o sys_trace.c:7:20: error: use of undeclared identifier 'PTRACE_ATTACH' if (0 > ptrace(PTRACE_ATTACH, pid, 0, 0)) { ^ sys_trace.c:16:20: error: use of undeclared identifier 'PTRACE_DETACH' if (0 > ptrace(PTRACE_DETACH, pid, (void ) 1, 0)) { ^ sys_trace.c:38:20: error: use of undeclared identifier 'PTRACE_PEEKDATA' *data = ptrace(PTRACE_PEEKDATA, pid, (void *) addr, 0); ^ sys_trace.c:83:20: warning: implicit declaration of function 'kill' is invalid in C99 [-Wimplicit-function-declaration] return kill(pid, sig); ^ 1 warning and 3 errors generated. make: ** [sys_trace.o] Error 1

    enhancement 
    opened by rickyliyi 7
  • PHP 7.0 failed tests (3)

    PHP 7.0 failed tests (3)

    PHP_VERSION : 7.0.15

    TEST 2/16 [tests/trace_002.phpt]
    ========DIFF========
    006-         > strlen("in trace_002_require.inc") called at [%s_require.inc:2]
    007-         < strlen("in trace_002_require.inc") = 24 called at [%s_require.inc:2] ~ %fs %fs
    012-         > strlen("in trace_002_include.inc") called at [%s_include.inc:2]
    013-         < strlen("in trace_002_include.inc") = 24 called at [%s_include.inc:2] ~ %fs %fs
    018-         > strlen("in trace_002_require.inc") called at [%s_require.inc:2]
    019-         < strlen("in trace_002_require.inc") = 24 called at [%s_require.inc:2] ~ %fs %fs
    019+     > call_normal() called at [/home/rpmbuild/SPECS/remirepo/php/pecl/php-pecl-trace/trace-1.0.0/extension/tests/trace_002.php:11]
    020+     < call_normal() = NULL called at [/home/rpmbuild/SPECS/remirepo/php/pecl/php-pecl-trace/trace-1.0.0/extension/tests/trace_002.php:11] ~ 0.000s 0.000s
    024-         > strlen("in trace_002_include.inc") called at [%s_include.inc:2]
    025-         < strlen("in trace_002_include.inc") = 24 called at [%s_include.inc:2] ~ %fs %fs
    027-     > call_user_func("call_normal") called at [%s:11]
    028-         > call_normal() called at [%s:11]
    029-         < call_normal() = NULL called at [%s:11] ~ %fs %fs
    030-     < call_user_func("call_normal") = NULL called at [%s:11] ~ %fs %fs
    046-         > strlen("shit") called at [%s(24) : eval()'d code:1]
    047-         < strlen("shit") = 4 called at [%s(24) : eval()'d code:1] ~ %fs %fs
    ========DONE========
    FAIL Trace include, require, lambda, eval [tests/trace_002.phpt] 
    TEST 3/16 [tests/trace_003.phpt]
    ========DIFF========
    043+     > TestClass->__toString() called at [/home/rpmbuild/SPECS/remirepo/php/pecl/php-pecl-trace/trace-1.0.0/extension/tests/trace_003.php:56]
    044+     < TestClass->__toString() = "" called at [/home/rpmbuild/SPECS/remirepo/php/pecl/php-pecl-trace/trace-1.0.0/extension/tests/trace_003.php:56] ~ 0.000s 0.000s
    043-     > strlen(object(TestClass)#1) called at [%s:56]
    044-         > TestClass->__toString() called at [%s:56]
    045-         < TestClass->__toString() = "" called at [%s:56] ~ %fs %fs
    046-     < strlen(object(TestClass)#1) = 0 called at [%s:56] ~ %fs %fs
    ========DONE========
    FAIL Trace Class and Object [tests/trace_003.phpt] 
    TEST 7/16 [tests/trace_007.phpt]
    ========DIFF========
    003+     > {closure:/home/rpmbuild/SPECS/remirepo/php/pecl/php-pecl-trace/trace-1.0.0/extension/tests/trace_007.php:7-9}() called at [/home/rpmbuild/SPECS/remirepo/php/pecl/php-pecl-trace/trace-1.0.0/extension/tests/trace_007.php:9]
    004+         > call_normal() called at [/home/rpmbuild/SPECS/remirepo/php/pecl/php-pecl-trace/trace-1.0.0/extension/tests/trace_007.php:8]
    005+         < call_normal() = NULL called at [/home/rpmbuild/SPECS/remirepo/php/pecl/php-pecl-trace/trace-1.0.0/extension/tests/trace_007.php:8] ~ 0.000s 0.000s
    006+     < {closure:/home/rpmbuild/SPECS/remirepo/php/pecl/php-pecl-trace/trace-1.0.0/extension/tests/trace_007.php:7-9}() = NULL called at [/home/rpmbuild/SPECS/remirepo/php/pecl/php-pecl-trace/trace-1.0.0/extension/tests/trace_007.php:9] ~ 0.000s 0.000s
    003-     > call_user_func(object(Closure)#1) called at [%s:9]
    004-         > {closure:%s:7-9}() called at [%s:9]
    005-             > call_normal() called at [%s:8]
    006-             < call_normal() = NULL called at [%s:8] ~ %fs %fs
    007-         < {closure:%s:7-9}() = NULL called at [%s:9] ~ %fs %fs
    008-     < call_user_func(object(Closure)#1) = NULL called at [%s:9] ~ %fs %fs
    ========DONE========
    FAIL Trace Closure [tests/trace_007.phpt] 
    
    
    bug 
    opened by remicollet 5
  • php7 support?

    php7 support?

    Does phptrace support php7 or not? I'm trying compile it under PHP 7.0.0-dev (cli) (built: Aug 27 2015 00:25:27) and failed. Here is the log (CentOS7 x64)

    Configuring for:
    PHP Api Version:         20131218
    Zend Module Api No:      20141001
    Zend Extension Api No:   320140815
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for a sed that does not truncate output... /bin/sed
    checking for cc... cc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables... 
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether cc accepts -g... yes
    checking for cc option to accept ISO C89... none needed
    checking how to run the C preprocessor... cc -E
    checking for icc... no
    checking for suncc... no
    checking whether cc understands -c and -o together... yes
    checking for system library directory... lib
    checking if compiler supports -R... no
    checking if compiler supports -Wl,-rpath,... yes
    checking build system type... x86_64-unknown-linux-gnu
    checking host system type... x86_64-unknown-linux-gnu
    checking target system type... x86_64-unknown-linux-gnu
    checking for PHP prefix... /root/.phpbrew/php/php-master
    checking for PHP includes... -I/root/.phpbrew/php/php-master/include/php -I/root/.phpbrew/php/php-master/include/php/main -I/root/.phpbrew/php/php-master/include/php/TSRM -I/root/.phpbrew/php/php-master/include/php/Zend -I/root/.phpbrew/php/php-master/include/php/ext -I/root/.phpbrew/php/php-master/include/php/ext/date/lib
    checking for PHP extension directory... /root/.phpbrew/php/php-master/lib/php/extensions/no-debug-non-zts-20141001
    checking for PHP installed headers prefix... /root/.phpbrew/php/php-master/include/php
    checking if debug is enabled... no
    checking if zts is enabled... no
    checking for re2c... no
    configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
    checking for gawk... gawk
    checking whether to enable trace support... yes, shared
    checking for mmap... yes
    checking for munmap... yes
    checking for ld used by cc... /bin/ld
    checking if the linker (/bin/ld) is GNU ld... yes
    checking for /bin/ld option to reload object files... -r
    checking for BSD-compatible nm... /bin/nm -B
    checking whether ln -s works... yes
    checking how to recognize dependent libraries... pass_all
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking dlfcn.h usability... yes
    checking dlfcn.h presence... yes
    checking for dlfcn.h... yes
    checking the maximum length of command line arguments... 1572864
    checking command to parse /bin/nm -B output from cc object... ok
    checking for objdir... .libs
    checking for ar... ar
    checking for ranlib... ranlib
    checking for strip... strip
    checking if cc supports -fno-rtti -fno-exceptions... no
    checking for cc option to produce PIC... -fPIC
    checking if cc PIC flag -fPIC works... yes
    checking if cc static flag -static works... no
    checking if cc supports -c -o file.o... yes
    checking whether the cc linker (/bin/ld -m elf_x86_64) supports shared libraries... yes
    checking whether -lc should be explicitly linked in... no
    checking dynamic linker characteristics... GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... yes
    checking whether to build static libraries... no
    
    creating libtool
    appending configuration tag "CXX" to libtool
    configure: creating ./config.status
    config.status: creating config.h
    make: Entering directory `/root/.phpbrew/build/php-master/ext/trace/extension'
    /bin/sh /root/.phpbrew/build/php-master/ext/trace/extension/libtool --mode=compile cc  -I. -I/root/.phpbrew/build/php-master/ext/trace/extension -DPHP_ATOM_INC -I/root/.phpbrew/build/php-master/ext/trace/extension/include -I/root/.phpbrew/build/php-master/ext/trace/extension/main -I/root/.phpbrew/build/php-master/ext/trace/extension -I/root/.phpbrew/php/php-master/include/php -I/root/.phpbrew/php/php-master/include/php/main -I/root/.phpbrew/php/php-master/include/php/TSRM -I/root/.phpbrew/php/php-master/include/php/Zend -I/root/.phpbrew/php/php-master/include/php/ext -I/root/.phpbrew/php/php-master/include/php/ext/date/lib -I/root/.phpbrew/build/php-master/ext/trace/extension/common  -DHAVE_CONFIG_H  -g -O2   -c /root/.phpbrew/build/php-master/ext/trace/extension/trace.c -o trace.lo 
    mkdir .libs
     cc -I. -I/root/.phpbrew/build/php-master/ext/trace/extension -DPHP_ATOM_INC -I/root/.phpbrew/build/php-master/ext/trace/extension/include -I/root/.phpbrew/build/php-master/ext/trace/extension/main -I/root/.phpbrew/build/php-master/ext/trace/extension -I/root/.phpbrew/php/php-master/include/php -I/root/.phpbrew/php/php-master/include/php/main -I/root/.phpbrew/php/php-master/include/php/TSRM -I/root/.phpbrew/php/php-master/include/php/Zend -I/root/.phpbrew/php/php-master/include/php/ext -I/root/.phpbrew/php/php-master/include/php/ext/date/lib -I/root/.phpbrew/build/php-master/ext/trace/extension/common -DHAVE_CONFIG_H -g -O2 -c /root/.phpbrew/build/php-master/ext/trace/extension/trace.c  -fPIC -DPIC -o .libs/trace.o
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c: In function ‘zm_startup_trace’:
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:208:29: warning: assignment from incompatible pointer type [enabled by default]
         pt_ori_execute_internal = zend_execute_internal;
                                 ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:209:27: warning: assignment from incompatible pointer type [enabled by default]
         zend_execute_internal = pt_execute_internal;
                               ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c: In function ‘zm_shutdown_trace’:
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:248:27: warning: assignment from incompatible pointer type [enabled by default]
         zend_execute_internal = pt_ori_execute_internal;
                               ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c: In function ‘pt_frame_build’:
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:330:12: error: ‘zend_execute_data’ has no member named ‘function_state’
         zf = ex->function_state.function;
                ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:345:21: error: ‘zend_execute_data’ has no member named ‘object’
             if (ex && ex->object) {
                         ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:352:17: warning: passing argument 1 of ‘sdsnew’ from incompatible pointer type [enabled by default]
                     frame->class = sdsnew(zf->common.scope->name);
                     ^
    In file included from /root/.phpbrew/build/php-master/ext/trace/extension/common/trace_type.h:21:0,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/common/trace_comm.h:22,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/php_trace.h:37,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:24:
    /root/.phpbrew/build/php-master/ext/trace/extension/common/sds/sds.h:58:5: note: expected ‘const char *’ but argument is of type ‘struct zend_string *’
     sds sdsnew(const char *init);
         ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:360:13: warning: passing argument 1 of ‘sdsnew’ from incompatible pointer type [enabled by default]
                 frame->class = sdsnew(zf->common.scope->name);
                 ^
    In file included from /root/.phpbrew/build/php-master/ext/trace/extension/common/trace_type.h:21:0,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/common/trace_comm.h:22,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/php_trace.h:37,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:24:
    /root/.phpbrew/build/php-master/ext/trace/extension/common/sds/sds.h:58:5: note: expected ‘const char *’ but argument is of type ‘struct zend_string *’
     sds sdsnew(const char *init);
         ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:366:9: warning: passing argument 1 of ‘strlen’ from incompatible pointer type [enabled by default]
             if (strcmp(zf->common.function_name, "{closure}") == 0) {
             ^
    In file included from /root/.phpbrew/php/php-master/include/php/main/../main/php_config.h:2483:0,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend_config.h:1,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend_portability.h:48,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend_types.h:26,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend.h:31,
                     from /root/.phpbrew/php/php-master/include/php/main/php.h:35,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:21:
    /usr/include/string.h:395:15: note: expected ‘const char *’ but argument is of type ‘struct zend_string *’
     extern size_t strlen (const char *__s)
                   ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:366:9: warning: passing argument 1 of ‘__builtin_strcmp’ from incompatible pointer type [enabled by default]
             if (strcmp(zf->common.function_name, "{closure}") == 0) {
             ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:366:9: note: expected ‘const char *’ but argument is of type ‘struct zend_string *’
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:366:9: warning: passing argument 1 of ‘strlen’ from incompatible pointer type [enabled by default]
    In file included from /root/.phpbrew/php/php-master/include/php/main/../main/php_config.h:2483:0,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend_config.h:1,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend_portability.h:48,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend_types.h:26,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend.h:31,
                     from /root/.phpbrew/php/php-master/include/php/main/php.h:35,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:21:
    /usr/include/string.h:395:15: note: expected ‘const char *’ but argument is of type ‘struct zend_string *’
     extern size_t strlen (const char *__s)
                   ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:366:9: warning: passing argument 1 of ‘__builtin_strcmp’ from incompatible pointer type [enabled by default]
             if (strcmp(zf->common.function_name, "{closure}") == 0) {
             ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:366:9: note: expected ‘const char *’ but argument is of type ‘struct zend_string *’
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:366:9: warning: passing argument 1 of ‘__builtin_strcmp’ from incompatible pointer type [enabled by default]
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:366:9: note: expected ‘const char *’ but argument is of type ‘struct zend_string *’
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:366:9: warning: passing argument 1 of ‘__builtin_strcmp’ from incompatible pointer type [enabled by default]
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:366:9: note: expected ‘const char *’ but argument is of type ‘struct zend_string *’
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:368:9: warning: passing argument 1 of ‘strlen’ from incompatible pointer type [enabled by default]
             } else if (strcmp(zf->common.function_name, "__lambda_func") == 0) {
             ^
    In file included from /root/.phpbrew/php/php-master/include/php/main/../main/php_config.h:2483:0,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend_config.h:1,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend_portability.h:48,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend_types.h:26,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend.h:31,
                     from /root/.phpbrew/php/php-master/include/php/main/php.h:35,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:21:
    /usr/include/string.h:395:15: note: expected ‘const char *’ but argument is of type ‘struct zend_string *’
     extern size_t strlen (const char *__s)
                   ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:368:9: warning: passing argument 1 of ‘__builtin_strcmp’ from incompatible pointer type [enabled by default]
             } else if (strcmp(zf->common.function_name, "__lambda_func") == 0) {
             ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:368:9: note: expected ‘const char *’ but argument is of type ‘struct zend_string *’
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:368:9: warning: passing argument 1 of ‘strlen’ from incompatible pointer type [enabled by default]
    In file included from /root/.phpbrew/php/php-master/include/php/main/../main/php_config.h:2483:0,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend_config.h:1,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend_portability.h:48,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend_types.h:26,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend.h:31,
                     from /root/.phpbrew/php/php-master/include/php/main/php.h:35,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:21:
    /usr/include/string.h:395:15: note: expected ‘const char *’ but argument is of type ‘struct zend_string *’
     extern size_t strlen (const char *__s)
                   ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:368:9: warning: passing argument 1 of ‘__builtin_strcmp’ from incompatible pointer type [enabled by default]
             } else if (strcmp(zf->common.function_name, "__lambda_func") == 0) {
             ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:368:9: note: expected ‘const char *’ but argument is of type ‘struct zend_string *’
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:368:9: warning: passing argument 1 of ‘__builtin_strcmp’ from incompatible pointer type [enabled by default]
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:368:9: note: expected ‘const char *’ but argument is of type ‘struct zend_string *’
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:368:9: warning: passing argument 1 of ‘__builtin_strcmp’ from incompatible pointer type [enabled by default]
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:368:9: note: expected ‘const char *’ but argument is of type ‘struct zend_string *’
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:376:65: error: ‘zend_execute_data’ has no member named ‘object’
                 frame->function = sdsnew(zend_resolve_method_name(ex->object ? Z_OBJCE_P(ex->object) : zf->common.scope, zf));
                                                                     ^
    In file included from /root/.phpbrew/php/php-master/include/php/Zend/zend.h:31:0,
                     from /root/.phpbrew/php/php-master/include/php/main/php.h:35,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:21:
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:376:88: error: ‘zend_execute_data’ has no member named ‘object’
                 frame->function = sdsnew(zend_resolve_method_name(ex->object ? Z_OBJCE_P(ex->object) : zf->common.scope, zf));
                                                                                            ^
    /root/.phpbrew/php/php-master/include/php/Zend/zend_types.h:529:26: note: in definition of macro ‘Z_OBJ’
     #define Z_OBJ(zval)     (zval).value.obj
                              ^
    /root/.phpbrew/php/php-master/include/php/Zend/zend_types.h:542:29: note: in expansion of macro ‘Z_OBJCE’
     #define Z_OBJCE_P(zval_p)   Z_OBJCE(*(zval_p))
                                 ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:376:76: note: in expansion of macro ‘Z_OBJCE_P’
                 frame->function = sdsnew(zend_resolve_method_name(ex->object ? Z_OBJCE_P(ex->object) : zf->common.scope, zf));
                                                                                ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:379:13: warning: passing argument 1 of ‘sdsnew’ from incompatible pointer type [enabled by default]
                 frame->function = sdsnew(zf->common.function_name);
                 ^
    In file included from /root/.phpbrew/build/php-master/ext/trace/extension/common/trace_type.h:21:0,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/common/trace_comm.h:22,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/php_trace.h:37,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:24:
    /root/.phpbrew/build/php-master/ext/trace/extension/common/sds/sds.h:58:5: note: expected ‘const char *’ but argument is of type ‘struct zend_string *’
     sds sdsnew(const char *init);
         ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:390:21: error: ‘zend_execute_data’ has no member named ‘function_state’
             if (ex && ex->function_state.arguments) {
                         ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:391:58: error: ‘zend_execute_data’ has no member named ‘function_state’
                 frame->arg_count = (int)(zend_uintptr_t) *(ex->function_state.arguments);
                                                              ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:392:32: error: ‘zend_execute_data’ has no member named ‘function_state’
                 args = (zval **)(ex->function_state.arguments - frame->arg_count);
                                    ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:453:13: warning: passing argument 1 of ‘strlen’ from incompatible pointer type [enabled by default]
                 frame->args[0] = sdscatrepr(sdsempty(), zf->op_array.filename, strlen(zf->op_array.filename));
                 ^
    In file included from /root/.phpbrew/php/php-master/include/php/main/../main/php_config.h:2483:0,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend_config.h:1,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend_portability.h:48,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend_types.h:26,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend.h:31,
                     from /root/.phpbrew/php/php-master/include/php/main/php.h:35,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:21:
    /usr/include/string.h:395:15: note: expected ‘const char *’ but argument is of type ‘struct zend_string *’
     extern size_t strlen (const char *__s)
                   ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:453:13: warning: passing argument 2 of ‘sdscatrepr’ from incompatible pointer type [enabled by default]
                 frame->args[0] = sdscatrepr(sdsempty(), zf->op_array.filename, strlen(zf->op_array.filename));
                 ^
    In file included from /root/.phpbrew/build/php-master/ext/trace/extension/common/trace_type.h:21:0,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/common/trace_comm.h:22,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/php_trace.h:37,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:24:
    /root/.phpbrew/build/php-master/ext/trace/extension/common/sds/sds.h:89:5: note: expected ‘const char *’ but argument is of type ‘struct zend_string *’
     sds sdscatrepr(sds s, const char *p, size_t len);
         ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:474:17: error: ‘zend_execute_data’ has no member named ‘op_array’
         if (ex && ex->op_array) {
                     ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:475:36: error: ‘zend_execute_data’ has no member named ‘op_array’
             frame->filename = sdsnew(ex->op_array->filename);
                                        ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:476:68: error: ‘zend_execute_data’ has no member named ‘op_array’
         } else if (ex && ex->prev_execute_data && ex->prev_execute_data->op_array) {
                                                                        ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:477:55: error: ‘zend_execute_data’ has no member named ‘op_array’
             frame->filename = sdsnew(ex->prev_execute_data->op_array->filename); /* try using prev */
                                                           ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:479:9: warning: passing argument 1 of ‘sdsnew’ from incompatible pointer type [enabled by default]
             frame->filename = sdsnew(op_array->filename);
             ^
    In file included from /root/.phpbrew/build/php-master/ext/trace/extension/common/trace_type.h:21:0,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/common/trace_comm.h:22,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/php_trace.h:37,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:24:
    /root/.phpbrew/build/php-master/ext/trace/extension/common/sds/sds.h:58:5: note: expected ‘const char *’ but argument is of type ‘struct zend_string *’
     sds sdsnew(const char *init);
         ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c: In function ‘pt_frame_set_retval’:
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:517:26: error: ‘zend_fcall_info’ has no member named ‘retval_ptr_ptr’
                 retval = *fci->retval_ptr_ptr;
                              ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:519:60: error: invalid type argument of ‘->’ (have ‘int’)
                 retval = EX_TMP_VAR(ex, ex->opline->result.var)->var.ptr;
                                                                ^
    In file included from /root/.phpbrew/php/php-master/include/php/Zend/zend_globals.h:28:0,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend_compile.h:656,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend_modules.h:26,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend_API.h:26,
                     from /root/.phpbrew/php/php-master/include/php/main/php.h:39,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:21:
    /root/.phpbrew/php/php-master/include/php/Zend/zend_globals_macros.h:46:33: error: ‘zend_executor_globals’ has no member named ‘return_value_ptr_ptr’
     # define EG(v) (executor_globals.v)
                                     ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:530:17: note: in expansion of macro ‘EG’
         } else if (*EG(return_value_ptr_ptr)) {
                     ^
    /root/.phpbrew/php/php-master/include/php/Zend/zend_globals_macros.h:46:33: error: ‘zend_executor_globals’ has no member named ‘return_value_ptr_ptr’
     # define EG(v) (executor_globals.v)
                                     ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:531:19: note: in expansion of macro ‘EG’
             retval = *EG(return_value_ptr_ptr);
                       ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c: In function ‘pt_repr_zval’:
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:755:14: error: ‘IS_BOOL’ undeclared (first use in this function)
             case IS_BOOL:
                  ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:755:14: note: each undeclared identifier is reported only once for each function it appears in
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:781:80: error: ‘zend_uint’ undeclared (first use in this function)
                     Z_OBJ_HANDLER(*zv, get_class_name)(zv, (const char **) &tstr, (zend_uint *) &tlen, 0 TSRMLS_CC);
                                                                                    ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:781:91: error: expected expression before ‘)’ token
                     Z_OBJ_HANDLER(*zv, get_class_name)(zv, (const char **) &tstr, (zend_uint *) &tlen, 0 TSRMLS_CC);
                                                                                               ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:781:91: warning: passing argument 1 of ‘zv->value.obj->handlers->get_class_name’ from incompatible pointer type [enabled by default]
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:781:91: note: expected ‘const struct zend_object *’ but argument is of type ‘struct zval *’
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:781:91: error: too many arguments to function ‘zv->value.obj->handlers->get_class_name’
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:789:13: warning: passing argument 1 of ‘zend_rsrc_list_get_rsrc_type’ makes pointer from integer without a cast [enabled by default]
                 tstr = (char *) zend_rsrc_list_get_rsrc_type(Z_LVAL_P(zv) TSRMLS_CC);
                 ^
    In file included from /root/.phpbrew/php/php-master/include/php/Zend/zend_API.h:27:0,
                     from /root/.phpbrew/php/php-master/include/php/main/php.h:39,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:21:
    /root/.phpbrew/php/php-master/include/php/Zend/zend_list.h:68:22: note: expected ‘struct zend_resource *’ but argument is of type ‘zend_long’
     ZEND_API const char *zend_rsrc_list_get_rsrc_type(zend_resource *res);
                          ^
    In file included from /root/.phpbrew/php/php-master/include/php/Zend/zend_globals.h:28:0,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend_compile.h:656,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend_modules.h:26,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend_API.h:26,
                     from /root/.phpbrew/php/php-master/include/php/main/php.h:39,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:21:
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c: In function ‘pt_execute_core’:
    /root/.phpbrew/php/php-master/include/php/Zend/zend_globals_macros.h:46:33: error: ‘zend_executor_globals’ has no member named ‘return_value_ptr_ptr’
     # define EG(v) (executor_globals.v)
                                     ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:909:26: note: in expansion of macro ‘EG’
             if (!internal && EG(return_value_ptr_ptr) == NULL) {
                              ^
    /root/.phpbrew/php/php-master/include/php/Zend/zend_globals_macros.h:46:33: error: ‘zend_executor_globals’ has no member named ‘return_value_ptr_ptr’
     # define EG(v) (executor_globals.v)
                                     ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:910:13: note: in expansion of macro ‘EG’
                 EG(return_value_ptr_ptr) = &retval;
                 ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:943:17: warning: passing argument 2 of ‘execute_internal’ from incompatible pointer type [enabled by default]
                     execute_internal(execute_data, fci, rvu TSRMLS_CC);
                     ^
    In file included from /root/.phpbrew/php/php-master/include/php/Zend/zend_API.h:30:0,
                     from /root/.phpbrew/php/php-master/include/php/main/php.h:39,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:21:
    /root/.phpbrew/php/php-master/include/php/Zend/zend_execute.h:42:15: note: expected ‘struct zval *’ but argument is of type ‘struct zend_fcall_info *’
     ZEND_API void execute_internal(zend_execute_data *execute_data, zval *return_value);
                   ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:943:17: error: too many arguments to function ‘execute_internal’
                     execute_internal(execute_data, fci, rvu TSRMLS_CC);
                     ^
    In file included from /root/.phpbrew/php/php-master/include/php/Zend/zend_API.h:30:0,
                     from /root/.phpbrew/php/php-master/include/php/main/php.h:39,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:21:
    /root/.phpbrew/php/php-master/include/php/Zend/zend_execute.h:42:15: note: declared here
     ZEND_API void execute_internal(zend_execute_data *execute_data, zval *return_value);
                   ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:973:13: warning: passing argument 1 of ‘_zval_ptr_dtor’ from incompatible pointer type [enabled by default]
                 zval_ptr_dtor(&retval);
                 ^
    In file included from /root/.phpbrew/php/php-master/include/php/Zend/zend.h:39:0,
                     from /root/.phpbrew/php/php-master/include/php/main/php.h:35,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:21:
    /root/.phpbrew/php/php-master/include/php/Zend/zend_variables.h:111:15: note: expected ‘struct zval *’ but argument is of type ‘struct zval **’
     ZEND_API void _zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC);
                   ^
    In file included from /root/.phpbrew/php/php-master/include/php/Zend/zend_globals.h:28:0,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend_compile.h:656,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend_modules.h:26,
                     from /root/.phpbrew/php/php-master/include/php/Zend/zend_API.h:26,
                     from /root/.phpbrew/php/php-master/include/php/main/php.h:39,
                     from /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:21:
    /root/.phpbrew/php/php-master/include/php/Zend/zend_globals_macros.h:46:33: error: ‘zend_executor_globals’ has no member named ‘return_value_ptr_ptr’
     # define EG(v) (executor_globals.v)
                                     ^
    /root/.phpbrew/build/php-master/ext/trace/extension/trace.c:974:13: note: in expansion of macro ‘EG’
                 EG(return_value_ptr_ptr) = NULL;
                 ^
    make: *** [trace.lo] Error 1
    make: Leaving directory `/root/.phpbrew/build/php-master/ext/trace/extension'
    
    
    feature 
    opened by jhdxr 4
  • 扩展名称不是phptrace.so  而是 trace.so

    扩展名称不是phptrace.so 而是 trace.so

    配置后发现没起作用 phptrace -p 9059 CONTROL ERROR: cannot open control mmap file /tmp/phptrace.ctrl (No such file or directory)

    检查后发现 .so文件名称为 trace.so

    提供的例子是 [phptrace] extension=phptrace.so phptrace.enabled = 1 实际上 这里应该改为 extension=trace.so

    opened by wwek 4
  • [make error] phptrace_execute_core

    [make error] phptrace_execute_core

    cc -I. -I/root/source/phptrace-master/phpext -DPHP_ATOM_INC -I/root/source/phptrace-master/phpext/include -I/root/source/phptrace-master/phpext/main -I/root/source/phptrace-master/phpext -I/data/local/php/include/php -I/data/local/php/include/php/main -I/data/local/php/include/php/TSRM -I/data/local/php/include/php/Zend -I/data/local/php/include/php/ext -I/data/local/php/include/php/ext/date/lib -I/root/source/phptrace-master/common -DHAVE_CONFIG_H -g -O2 -c /root/source/phptrace-master/phpext/phptrace.c -fPIC -DPIC -o .libs/phptrace.o /root/source/phptrace-master/phpext/phptrace.c: 在函数‘phptrace_execute_core’中: /root/source/phptrace-master/phpext/phptrace.c:508: 警告:对‘long’类型而言整数常量太大 /root/source/phptrace-master/phpext/phptrace.c:509: 警告:对‘long’类型而言整数常量太大 make: *** 没有规则可以创建“common/phptrace_mmap.lo”需要的目标“/root/source/phptrace-master/phpext/common/phptrace_mmap.c”。 停止。

    my sys info: Linux localhost 2.6.32-279.el6.i686 #1 SMP Fri Jun 22 10:59:55 UTC 2012 i686 i686 i386 GNU/Linux php 5.3.27

    opened by rryqszq4 4
  • failed to ptrace(PEEKDATA) pid

    failed to ptrace(PEEKDATA) pid

    [root@simon cmdtool]# ./phptrace -p 5435 -s phptrace 0.1 demo, published by infra webcore team [5494] 30 Dec 15:52:14.016 # failed to ptrace(PEEKDATA) pid 5435 [5494] 30 Dec 15:52:15.017 # failed to ptrace(PEEKDATA) pid 5435 [5494] 30 Dec 15:52:16.017 # failed to ptrace(PEEKDATA) pid 5435 dump stack failed!

    这是什么问题引起的

    help wanted 
    opened by zhaoyong2006 4
  • PHP 7.2: failed test

    PHP 7.2: failed test

    Yes, early report ;)

    TEST 7/20 [tests/trace_002.phpt]
    ========DIFF========
    021+     > include("/builddir/build/BUILD/php72-php-pecl-trace-1.0.1/trace-1.0.1beta/extension/tests/trace_002_include.inc") called at [/builddir/build/BUILD/php72-php-pec
    022+ Deprecated: Function create_function() is deprecated in /builddir/build/BUILD/php72-php-pecl-trace-1.0.1/trace-1.0.1beta/extension/tests/trace_002.php on line 11
    023+ l-trace-1.0.1/trace-1.0.1beta/extension/tests/trace_002.php:8]
    021-     > include("%s_include.inc") called at [%s:8]
    029+ 
    030+ Deprecated: Function create_function() is deprecated in /builddir/build/BUILD/php72-php-pecl-trace-1.0.1/trace-1.0.1beta/extension/tests/trace_002.php on line 13
    ========DONE========
    FAIL Trace include, require, lambda, eval [tests/trace_002.phpt] 
    
    Tests failed    :    1 (  5.0%) ( 14.3%)
    Tests passed    :    6 ( 30.0%) ( 85.7%)
    
    
    opened by remicollet 3
  • PHP 7.1 build

    PHP 7.1 build

    /home/rpmbuild/SPECS/remirepo/php/pecl/php-pecl-trace/trace-1.0.0/extension/trace.c: Dans la fonction « frame_build »:
    /home/rpmbuild/SPECS/remirepo/php/pecl/php-pecl-trace/trace-1.0.0/extension/trace.c:629:12: attention : variable « args » set but not used [-Wunused-but-set-variable]
         zval **args;
                ^~~~
    /home/rpmbuild/SPECS/remirepo/php/pecl/php-pecl-trace/trace-1.0.0/extension/trace.c: Dans la fonction « pt_execute_core »:
    /home/rpmbuild/SPECS/remirepo/php/pecl/php-pecl-trace/trace-1.0.0/extension/trace.c:1273:13: attention : implicit declaration of function « Z_VAR_FLAGS » [-Wimplicit-function-declaration]
                 Z_VAR_FLAGS(retval) = 0;
                 ^~~~~~~~~~~
    /home/rpmbuild/SPECS/remirepo/php/pecl/php-pecl-trace/trace-1.0.0/extension/trace.c:1273:33: erreur : lvalue required as left operand of assignment
                 Z_VAR_FLAGS(retval) = 0;
                                     ^
    Au plus haut niveau:
    /home/rpmbuild/SPECS/remirepo/php/pecl/php-pecl-trace/trace-1.0.0/extension/trace.c:142:12: attention : « le_trace » defined but not used [-Wunused-variable]
     static int le_trace;
                ^~~~~~~~
    
    
    enhancement 
    opened by remicollet 3
  • [make test failed]

    [make test failed]

    FAIL Trace various handlers [tests/trace_004.phpt] PHP版本是 5.6.12

    PHP : /home/service/php/bin/php PHP_SAPI : cli PHP_VERSION : 5.6.12 ZEND_VERSION: 2.6.0 PHP_OS : Linux - Linux 2.6.32-888.el6.x86_64 #1 SMP Fri Feb 13 12:14:55 CST 2015 x86_64 INI actual : /home/work/trace-0.3.0/extension/tmp-php.ini More .INIs : CWD : /home/work/trace-0.3.0/extension Extra dirs :

    VALGRIND : Not used

    TIME START 2016-03-15 11:07:01

    PASS Trace simple call with various types of argument [tests/trace_001.phpt] PASS Trace include, require, lambda, eval [tests/trace_002.phpt] PASS Trace Class and Object [tests/trace_003.phpt] FAIL Trace various handlers [tests/trace_004.phpt] SKIP Trace signal handler [tests/trace_005.phpt] reason: trace_start() not exists SKIP Trace call under namespace [tests/trace_006.phpt] reason: trace_start() not exists SKIP Trace Closure [tests/trace_007.phpt] reason: trace_start() not exists SKIP Trace magic method __callStatic, __invoke [tests/trace_008.phpt] reason: trace_start() not exists PASS Trace call recursive [tests/trace_009.phpt] SKIP Trace call trigger by autoload < 5.5 [tests/trace_010.phpt] reason: trace_start() not exists SKIP Trace call trigger by autoload >= 5.5 [tests/trace_011.phpt] reason: trace_start() not exists

    SKIP Trace Trait [tests/trace_012.phpt] reason: trace_start() not exists

    TIME END 2016-03-15 11:07:01

    TEST RESULT SUMMARY

    Exts skipped : 0

    Exts tested : 47

    Number of tests : 12 5 Tests skipped : 7 ( 58.3%) -------- Tests warned : 0 ( 0.0%) ( 0.0%) Tests failed : 1 ( 8.3%) ( 20.0%) Expected fail : 0 ( 0.0%) ( 0.0%) Tests passed : 4 ( 33.3%) ( 80.0%)

    能帮忙看下是环境的问题么?

    question 
    opened by adxhyt 3
  • Other examples of how to use phptrace?

    Other examples of how to use phptrace?

    The canonical example works fine:

    $ php -r 'for ($i = 0; $i < 100; $i++) usleep(10000);' & ./phptrace -p $!
    

    After the following small modification, the tracing program does not output anything:

    $ php -r 'for ($i = 0; $i < 100; $i++) echo "$i\n";' & ./phptrace -p $!
    

    By the time phptrace gets called, in my impression, the program has terminated already. Any example of how to make it work anyway?

    help wanted 
    opened by eriksank 3
  • Not Working

    Not Working

    I have installed the tool and tried the sample check its not working. Not Working : By not working i mean there are no trace i can see. I have added the extension and php.ini parsing and execution where susccessfull

    question 
    opened by sarathsp06 3
  • Tracing Application

    Tracing Application

    Hi Dear Please help me out. I am not able to trace the application that is running on apache2 server. After injecting in the pid of apache2 server . And after that hitting the application i am not able to get the data..

    Please help me out that it is possible to trace application that is running on server like apache2

    opened by rahmatrh199 0
  • Compilation error

    Compilation error

    /data/data/com.termux/files/home/phptrace-1.0.1-beta/extension/common/trace_comm.c:107:30: error: use of undeclared identifier 'ALLPERMS' if (chmod(addr.sun_path, ALLPERMS) == 0) { ^

    u0_a115@localhost:~/phptrace-1.0.1-beta/extension $ php -v
    

    PHP 7.4.1 (cli) (built: Jan 5 2020 23:23:59) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Xdebug v2.9.0, Copyright (c) 2002-2019, by Derick Rethans

    u0_a115@localhost:~/phptrace-1.0.1-beta/extension $ uname -a
    

    Linux localhost 3.18.71-perf-g5c5b6e3 #1 SMP PREEMPT Tue Nov 5 23:37:25 WIB 2019 aarch64 Android

    opened by Cvar1984 0
  • FAIL Trace include, require, lambda, eval [tests/trace_002.phpt]

    FAIL Trace include, require, lambda, eval [tests/trace_002.phpt]

    `

    PHP : /usr/bin/php7.2 PHP_SAPI : cli PHP_VERSION : 7.2.24-1+ubuntu16.04.1+deb.sury.org+1 ZEND_VERSION: 3.2.0 PHP_OS : Linux - Linux zyhazz-bet 4.4.0-165-generic #193-Ubuntu SMP Tue Sep 17 17:42:52 UTC 2019 x86_64 INI actual : /root/trace-1.0.1beta/extension/tmp-php.ini More .INIs : CWD : /root/trace-1.0.1beta/extension Extra dirs : VALGRIND : Not used

    TIME START 2019-10-26 13:18:52

    SKIP Trace signal handler < 7.1 [tests/pcntl_001.phpt] reason: Debug mode is required SKIP Trace signal handler >= 7.1 [tests/pcntl_002.phpt] reason: Debug mode is required PASS Trace with arguments by-reference #Issue 77 [tests/refargs.phpt] PASS Trace special function >= 7.0 [tests/special_func_001.phpt] SKIP Trace special function < 7.0 && >= 5.3 [tests/special_func_002.phpt] reason: Required version < 7.0 && >= 5.3> cli php /root/trace-1.0.1beta/extension/tests/special_func_002.skip.php PASS Trace simple call with various types of argument [tests/trace_001.phpt] FAIL Trace include, require, lambda, eval [tests/trace_002.phpt] PASS Trace Class and Object [tests/trace_003.phpt] PASS Trace various handlers [tests/trace_004.phpt] SKIP Trace call under namespace [tests/trace_006.phpt] reason: Debug mode is required SKIP Trace Closure [tests/trace_007.phpt] reason: Debug mode is required SKIP Trace magic method __callStatic, __invoke [tests/trace_008.phpt] reason: Debug mode is required PASS Trace call recursive [tests/trace_009.phpt] SKIP Trace call trigger by autoload < 5.5 [tests/trace_010.phpt] reason: Debug mode is required SKIP Trace call trigger by autoload >= 5.5 [tests/trace_011.phpt] reason: Debug mode is required SKIP Trace Trait [tests/trace_012.phpt] reason: Debug mode is required SKIP Trace tick handlers >= 5.6.12 [tests/trace_013.phpt] reason: Debug mode is required SKIP Trace tick handlers < 5.6.12 [tests/trace_014.phpt] reason: Debug mode is required SKIP Trace filter function name [tests/trace_015.phpt] reason: Debug mode is required SKIP Trace filter class name [tests/trace_016.phpt] reason: Debug mode is required

    TIME END 2019-10-26 13:18:52

    ===================================================================== TEST RESULT SUMMARY

    Exts skipped : 0 Exts tested : 15

    Number of tests : 20 7 Tests skipped : 13 ( 65.0%) -------- Tests warned : 0 ( 0.0%) ( 0.0%) Tests failed : 1 ( 5.0%) ( 14.3%) Expected fail : 0 ( 0.0%) ( 0.0%) Tests passed : 6 ( 30.0%) ( 85.7%)

    Time taken : 0 seconds

    ===================================================================== FAILED TEST SUMMARY

    Trace include, require, lambda, eval [tests/trace_002.phpt]

    `

    opened by zyhazz 0
  • mac 上使用pecl 安装失败

    mac 上使用pecl 安装失败

    截取了一部分错误 ^~~~ /private/tmp/pear/temp/trace/extension/trace.c:379:38: warning: incompatible pointer types passing 'zend_string *' (aka 'struct _zend_string *') to parameter of type 'const char ' [-Wincompatible-pointer-types] frame->function = sdsnew(zf->common.function_name); /usr/local/Cellar/[email protected]/7.1.25/include/php/Zend/zend_types.h:514:28: note: expanded from macro 'Z_LVAL_P' #define Z_LVAL_P(zval_p) Z_LVAL((zval_p)) ^~~~~~~~~~~~~~~~~ /usr/local/Cellar/[email protected]/7.1.25/include/php/Zend/zend_types.h:513:25: note: expanded from macro 'Z_LVAL' #define Z_LVAL(zval) (zval).value.lval ^~~~~~~~~~~~~~~~~ /private/tmp/pear/temp/trace/extension/trace.c:909:29: error: no member named 'return_value_ptr_ptr' in 'struct _zend_executor_globals' if (!internal && EG(return_value_ptr_ptr) == NULL) { ~~~^~~~~~~~~~~~~~~~~~~~~ /usr/local/Cellar/[email protected]/7.1.25/include/php/Zend/zend_globals_macros.h:46:34: note: expanded from macro 'EG'

    define EG(v) (executor_globals.v)

                ~~~~~~~~~~~~~~~~ ^
    

    fatal error: too many errors emitted, stopping now [-ferror-limit=] 16 warnings and 20 errors generated. make: *** [trace.lo] Error 1 ERROR: `make' failed

    opened by jackwangshukai 0
Releases(v1.0.1-beta)
  • v1.0.1-beta(Mar 14, 2017)

    • Support PHP 7.1
    • Refactor the CLI tool, with a convenient sub-commands mode
    • Add filter for URL, class name, function name in trace mode
    • Add feature to trace all process
    • Add exclusive time calculation
    • Colorized output
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(May 15, 2015)

    Added

    • Added support for special function calls: main, include, require, Closure, Labmda, eval()
    • Added support for PHP 5.1
    • Keep collecting and sending back trace information after PHP bailout
    • Added duplexing to communication module
    • Compatible with Trait Alias
    • Added checking for ZTS (Thread-safety support) during configuration

    Changed

    • Refactor the PHP extension
    • Unified the naming convention of Type, Function, Macro
    • Change License to Apache 2.0
    • Change Extension's name to "trace" (php is redundant for a PHP extension)
    • Improve representation of zval and support for Array, Object
    • Improve performance when trace if off
    • Limit the length of print arguments and retvalue

    Fixed

    • Fixed handling of large or small double value that needs scientific notation
    • Fixed memory leaks related with SDS
    Source code(tar.gz)
    Source code(zip)
  • v0.2.2(Jan 28, 2015)

    Changelog

    • Fix #15 , update mmap filename failed when rotates tracelog.
    • Rename the internal binary name from php-trace to trace-php to avoid confusing when using auto complement
    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(Jan 22, 2015)

  • v0.2.0(Jan 16, 2015)

    This is a stable release of phptrace, feel free to use it in production environment.

    Changelog:

    feature

    • Support Mac OS X (just the trace feature)
    • Support PID which is bigger than 32768
    • Support PHP 5.6+
    • More human friendly error message
    • Remove the temporary tracelog once open

    bugfix

    • Probably cause segfault on PHP5.5 +
    • Probably cause segfault when fetch the return value of PHP extension functions
    • Replace usleep with sleep to be compatible with more os platforms
    • Fix phptrace script syntax error
    • Fix fd leak when stop trace in the extension
    Source code(tar.gz)
    Source code(zip)
Owner
Qihoo 360
360 official github
Qihoo 360
A set of PHP scripts which leverage MySQL INFORMATION_SCHEMA to create log tables and insert / update triggers

mysql-logtable-php mysql-logtable-php is a set of PHP scripts which leverage MySQL INFORMATION_SCHEMA to create log tables and insert / update trigger

null 3 Feb 27, 2022
A lot of scripts and packages in modern PHP demand one or more configuration classes

A lot of scripts and packages in modern PHP demand one or more configuration classes. Mostly, those are a set of properties that can be set, changed or retrieved. However, some of the configurations have a peculiar behaviour - such as boolean properties.

Carlos Artur Curvelo da Silva Matos 2 Mar 8, 2022
Magento-bulk - Bulk Import/Export helper scripts and CLI utilities for Magento Commerce

Magento Bulk Bulk operations for Magento. Configuration Copy config.php.sample to config.php and edit it. Product Attribute Management List All Attrib

Bippo Indonesia 23 Dec 20, 2022
The simplest way to create a dynamic sitemap for your self-coded website which you have made by using PHP/HTML/CSS/Js etc... Scripts.

Sitemap_index.xml The simplest way to create a dynamic sitemap for your self-coded website which you have made by using PHP/HTML/CSS/Js etc... Scripts

Tanish Raj 1 Oct 16, 2021
Run PHP scripts on the fly at runtime on a PocketMine-MP server (useful for debugging)

Scripter Run PHP scripts on the fly at runtime on a PocketMine-MP server. This is useful for runtime debugging, when you don't want to restart the ser

Dylan's PocketMine-MP Plugins 15 Jul 28, 2022
Block malicious scripts using botscout.com protection for your laravel app

Laravel BotScout Protect your website against automated scripts using the botscout.com API. Installation You can install the package via composer: com

Nicolas Beauvais 64 Jul 30, 2022
Composer plugin replacing placeholders in the scripts section by dynamic values

Composer Substitution Plugin The Composer Substitution plugin replaces placeholders in the scripts section by dynamic values. It also permits to cache

Fabien Villepinte 49 Jan 8, 2022
Scripts-dev directive for composer

scriptsdev for Composer It's like require-dev, but for scripts Installation Just run composer require neronmoon/scriptsdev --dev Usage After installin

Vitaliy Krasnoperov 67 May 18, 2022
One-file composer scripts

Melody - One-file composer scripts Create a file named test.php: <?php <<<CONFIG packages: - "symfony/finder: ~2.8" CONFIG; $finder = Symfony\Com

SensioLabs 399 Aug 18, 2022
Magento Deployment Scripts

Magento Deployment Scripts Author: Fabrizio Branca This is a collection of scripts used to build/package, deploy and install Magento projects. Import

AOE 71 Sep 29, 2022
Pug Renderer - a (heavily based on the PhpRenderer) renderer for rendering Pug view scripts into a PSR-7 Response object

Pug Renderer This is a (heavily based on the PhpRenderer) renderer for rendering Pug view scripts into a PSR-7 Response object. It works well with Sli

Marcello Duarte 6 Oct 27, 2020
PHP_Depend is an adaptation of the established Java development tool JDepend. This tool shows you the quality of your design in terms of extensibility, reusability and maintainability.

PHP Depend Documentation PHP Depend for enterprise Available as part of the Tidelift Subscription. The maintainers of PHP Depend and thousands of othe

PHP_Depend 837 Dec 14, 2022
A tool for diff'ing this and OpenTHC lab metrics, creating their objects, and docs.

wcia-analytes-tool Consumes OpenTHC Lab Metrics and WCIA Analytes, and produces diff objects and docs for use in WA State interop. version 0.9.8 Getti

Confidence Analytics 1 Jan 15, 2022
A tool that allows to quickly export data from Magento 1 and Magento 2 store and import it back into Magento 2

Simple Import / Export tool A tool that allows to quickly export data from Magento 1 and Magento 2 store and import it back into Magento 2. Table data

EcomDev B.V. 51 Dec 5, 2022
Beautiful and understandable static analysis tool for PHP

PhpMetrics PhpMetrics provides metrics about PHP project and classes, with beautiful and readable HTML report. Documentation | Twitter | Contributing

PhpMetrics 2.3k Jan 5, 2023
Find undefined and unused variables with the PHP Codesniffer static analysis tool.

PHP_CodeSniffer VariableAnalysis Plugin for PHP_CodeSniffer static analysis tool that adds analysis of problematic variable use. Warns if variables ar

Payton Swick 116 Dec 14, 2022
PHP Parallel Lint - This tool check syntax of PHP files faster than serial check with fancier output

PHP Parallel Lint This application checks syntax of PHP files in parallel. It can output in plain text, colored text, json and checksyntax formats. Ad

PHP Parallel lint 156 Apr 24, 2022
Skosmos is a web-based tool providing services for accessing controlled vocabularies, which are used by indexers describing documents and searchers looking for suitable keywords.

Skosmos is a web-based tool providing services for accessing controlled vocabularies, which are used by indexers describing documents and searchers looking for suitable keywords.

National Library of Finland 195 Dec 24, 2022