phacility / xhprof

XHProf is a function-level hierarchical profiler for PHP and has a simple HTML based user interface.
http://pecl.php.net/package/xhprof
Apache License 2.0
2.6k stars 925 forks source link

make error (PHP7 on Mac) #88

Closed lin-credible closed 5 years ago

lin-credible commented 8 years ago
➜  ~ php -v  
PHP 7.0.6 (cli) (built: Apr 29 2016 04:21:39) ( NTS )  
Copyright (c) 1997-2016 The PHP Group  
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies  

😭 😒

➜  ~ sudo pecl install xhprof-beta
......

running: make
/bin/sh /private/tmp/pear/install/pear-build-rootUysn3G/xhprof-0.9.4/libtool --mode=compile cc  -I. -I/private/tmp/pear/install/xhprof/extension -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootUysn3G/xhprof-0.9.4/include -I/private/tmp/pear/install/pear-build-rootUysn3G/xhprof-0.9.4/main -I/private/tmp/pear/install/xhprof/extension -I/usr/local/Cellar/php70/7.0.6/include/php -I/usr/local/Cellar/php70/7.0.6/include/php/main -I/usr/local/Cellar/php70/7.0.6/include/php/TSRM -I/usr/local/Cellar/php70/7.0.6/include/php/Zend -I/usr/local/Cellar/php70/7.0.6/include/php/ext -I/usr/local/Cellar/php70/7.0.6/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /private/tmp/pear/install/xhprof/extension/xhprof.c -o xhprof.lo
mkdir .libs
 cc -I. -I/private/tmp/pear/install/xhprof/extension -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootUysn3G/xhprof-0.9.4/include -I/private/tmp/pear/install/pear-build-rootUysn3G/xhprof-0.9.4/main -I/private/tmp/pear/install/xhprof/extension -I/usr/local/Cellar/php70/7.0.6/include/php -I/usr/local/Cellar/php70/7.0.6/include/php/main -I/usr/local/Cellar/php70/7.0.6/include/php/TSRM -I/usr/local/Cellar/php70/7.0.6/include/php/Zend -I/usr/local/Cellar/php70/7.0.6/include/php/ext -I/usr/local/Cellar/php70/7.0.6/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/install/xhprof/extension/xhprof.c  -fno-common -DPIC -o .libs/xhprof.o
/private/tmp/pear/install/xhprof/extension/xhprof.c:662:5: warning: implicit declaration of function 'FREE_ZVAL' is invalid in C99 [-Wimplicit-function-declaration]
    FREE_ZVAL(hp_globals.stats_count);
    ^
/private/tmp/pear/install/xhprof/extension/xhprof.c:664:3: warning: implicit declaration of function 'MAKE_STD_ZVAL' is invalid in C99 [-Wimplicit-function-declaration]
  MAKE_STD_ZVAL(hp_globals.stats_count);
  ^
/private/tmp/pear/install/xhprof/extension/xhprof.c:931:23: error: no member named 'function_state' in 'struct _zend_execute_data'
    curr_func = data->function_state.function;
                ~~~~  ^
/private/tmp/pear/install/xhprof/extension/xhprof.c:934:10: warning: incompatible pointer types assigning to 'const char *' from 'zend_string *' (aka 'struct _zend_string *') [-Wincompatible-pointer-types]
    func = curr_func->common.function_name;
         ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/private/tmp/pear/install/xhprof/extension/xhprof.c:945:13: warning: incompatible pointer types assigning to 'const char *' from 'zend_string *' (aka 'struct _zend_string *') [-Wincompatible-pointer-types]
        cls = curr_func->common.scope->name;
            ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/private/tmp/pear/install/xhprof/extension/xhprof.c:946:24: error: no member named 'object' in 'struct _zend_execute_data'
      } else if (data->object) {
                 ~~~~  ^
/private/tmp/pear/install/xhprof/extension/xhprof.c:947:30: error: no member named 'object' in 'struct _zend_execute_data'
        cls = Z_OBJCE(*data->object)->name;
                       ~~~~  ^
/usr/local/Cellar/php70/7.0.6/include/php/Zend/zend_types.h:542:33: note: expanded from macro 'Z_OBJCE'
#define Z_OBJCE(zval)                           (Z_OBJ(zval)->ce)
                                                       ^~~~
/usr/local/Cellar/php70/7.0.6/include/php/Zend/zend_types.h:530:26: note: expanded from macro 'Z_OBJ'
#define Z_OBJ(zval)                                     (zval).value.obj
                                                         ^~~~
/private/tmp/pear/install/xhprof/extension/xhprof.c:1002:41: warning: incompatible pointer types passing 'zend_string *' (aka 'struct _zend_string *') to parameter of type 'const char *' [-Wincompatible-pointer-types]
        filename = hp_get_base_filename((curr_func->op_array).filename);
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/private/tmp/pear/install/xhprof/extension/xhprof.c:892:53: note: passing argument to parameter 'filename' here
static const char *hp_get_base_filename(const char *filename) {
                                                    ^
/private/tmp/pear/install/xhprof/extension/xhprof.c:1082:32: error: too many arguments to function call, expected 2, have 4
  if (zend_hash_find(ht, name, strlen(name) + 1, &data) == SUCCESS) {
      ~~~~~~~~~~~~~~           ^~~~~~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/php70/7.0.6/include/php/Zend/zend_hash.h:154:1: note: 'zend_hash_find' declared here
ZEND_API zval* ZEND_FASTCALL zend_hash_find(const HashTable *ht, zend_string *key);
^
/usr/local/Cellar/php70/7.0.6/include/php/main/php_config.h:6:19: note: expanded from macro 'ZEND_API'
# define ZEND_API __attribute__ ((visibility("default")))
                  ^
/private/tmp/pear/install/xhprof/extension/xhprof.c:1083:30: warning: implicit declaration of function 'Z_LVAL_PP' is invalid in C99 [-Wimplicit-function-declaration]
    ZVAL_LONG(*(zval**)data, Z_LVAL_PP((zval**)data) + count);
                             ^
/private/tmp/pear/install/xhprof/extension/xhprof.c:1106:34: error: too many arguments to function call, expected 2, have 4
  if (zend_hash_find(ht, symbol, strlen(symbol) + 1, &data) == SUCCESS) {
      ~~~~~~~~~~~~~~             ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/php70/7.0.6/include/php/Zend/zend_hash.h:154:1: note: 'zend_hash_find' declared here
ZEND_API zval* ZEND_FASTCALL zend_hash_find(const HashTable *ht, zend_string *key);
^
/usr/local/Cellar/php70/7.0.6/include/php/main/php_config.h:6:19: note: expanded from macro 'ZEND_API'
# define ZEND_API __attribute__ ((visibility("default")))
                  ^
/private/tmp/pear/install/xhprof/extension/xhprof.c:1170:20: error: too many arguments provided to function-like macro invocation
                   1);
                   ^
/usr/local/Cellar/php70/7.0.6/include/php/Zend/zend_API.h:406:9: note: macro 'add_assoc_string' defined here
#define add_assoc_string(__arg, __key, __str) add_assoc_string_ex(__arg, __key, strlen(__key), __str)
        ^
/private/tmp/pear/install/xhprof/extension/xhprof.c:1167:3: error: use of undeclared identifier 'add_assoc_string'
  add_assoc_string(hp_globals.stats_count,
  ^
/private/tmp/pear/install/xhprof/extension/xhprof.c:1245:7: warning: implicit declaration of function 'thread_policy_set' is invalid in C99 [-Wimplicit-function-declaration]
  if (SET_AFFINITY(0, sizeof(cpu_set_t), &new_mask) < 0) {
      ^
/private/tmp/pear/install/xhprof/extension/xhprof.c:61:9: note: expanded from macro 'SET_AFFINITY'
        thread_policy_set(mach_thread_self(), THREAD_AFFINITY_POLICY, mask, \
        ^
/private/tmp/pear/install/xhprof/extension/xhprof.c:1645:38: error: no member named 'op_array' in 'struct _zend_execute_data'
  zend_op_array *ops = execute_data->op_array;
                       ~~~~~~~~~~~~  ^
/private/tmp/pear/install/xhprof/extension/xhprof.c:1698:45: error: no member named 'op_array' in 'struct _zend_execute_data'
  func = hp_get_function_name(current_data->op_array TSRMLS_CC);
                              ~~~~~~~~~~~~  ^
/private/tmp/pear/install/xhprof/extension/xhprof.c:1706:14: warning: initializing 'zend_op *' (aka 'struct _zend_op *') with an expression of type 'const zend_op *' (aka 'const struct _zend_op *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
    zend_op *opline = EX(opline);
             ^        ~~~~~~~~~~
/private/tmp/pear/install/xhprof/extension/xhprof.c:1708:5: error: use of undeclared identifier 'temp_variable'
    temp_variable *retvar = &EX_T(opline->result.var);
    ^
/private/tmp/pear/install/xhprof/extension/xhprof.c:1708:20: error: use of undeclared identifier 'retvar'
    temp_variable *retvar = &EX_T(opline->result.var);
                   ^
/private/tmp/pear/install/xhprof/extension/xhprof.c:1708:30: warning: implicit declaration of function 'EX_TMP_VAR' is invalid in C99 [-Wimplicit-function-declaration]
    temp_variable *retvar = &EX_T(opline->result.var);
                             ^
/private/tmp/pear/install/xhprof/extension/xhprof.c:1688:24: note: expanded from macro 'EX_T'
#define EX_T(offset) (*EX_TMP_VAR(execute_data, offset))
                       ^
/private/tmp/pear/install/xhprof/extension/xhprof.c:1708:30: error: indirection requires pointer operand ('int' invalid)
    temp_variable *retvar = &EX_T(opline->result.var);
                             ^~~~~~~~~~~~~~~~~~~~~~~~
/private/tmp/pear/install/xhprof/extension/xhprof.c:1688:23: note: expanded from macro 'EX_T'
#define EX_T(offset) (*EX_TMP_VAR(execute_data, offset))
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/private/tmp/pear/install/xhprof/extension/xhprof.c:1709:36: error: no member named 'function_state' in 'struct _zend_execute_data'
    ((zend_internal_function *) EX(function_state).function)->handler(
                                ~~~^~~~~~~~~~~~~~~
/private/tmp/pear/install/xhprof/extension/xhprof.c:1673:38: note: expanded from macro 'EX'
#define EX(element) ((execute_data)->element)
                     ~~~~~~~~~~~~~~  ^
/private/tmp/pear/install/xhprof/extension/xhprof.c:1712:28: error: no member named 'function_state' in 'struct _zend_execute_data'
                       (EX(function_state).function->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ?
                        ~~~^~~~~~~~~~~~~~~
/private/tmp/pear/install/xhprof/extension/xhprof.c:1673:38: note: expanded from macro 'EX'
#define EX(element) ((execute_data)->element)
                     ~~~~~~~~~~~~~~  ^
/private/tmp/pear/install/xhprof/extension/xhprof.c:1714:27: error: no member named 'object' in 'struct _zend_execute_data'
                       EX(object), ret TSRMLS_CC);
                       ~~~^~~~~~~
/private/tmp/pear/install/xhprof/extension/xhprof.c:1673:38: note: expanded from macro 'EX'
#define EX(element) ((execute_data)->element)
                     ~~~~~~~~~~~~~~  ^
/private/tmp/pear/install/xhprof/extension/xhprof.c:1711:24: error: use of undeclared identifier 'retvar'
                       retvar->var.ptr,
                       ^
/private/tmp/pear/install/xhprof/extension/xhprof.c:1830:28: warning: incompatible pointer types assigning to 'void (*)(zend_execute_data *, struct _zend_fcall_info *, int)' (aka 'void (*)(struct _zend_execute_data *, struct _zend_fcall_info *, int)') from 'void (*)(zend_execute_data *, zval *)' (aka 'void (*)(struct _zend_execute_data *, struct _zval_struct *)') [-Wincompatible-pointer-types]
    _zend_execute_internal = zend_execute_internal;
                           ^ ~~~~~~~~~~~~~~~~~~~~~
/private/tmp/pear/install/xhprof/extension/xhprof.c:1835:29: warning: incompatible pointer types assigning to 'void (*)(zend_execute_data *, zval *)' (aka 'void (*)(struct _zend_execute_data *, struct _zval_struct *)') from 'void (zend_execute_data *, struct _zend_fcall_info *, int)' (aka 'void (struct _zend_execute_data *, struct _zend_fcall_info *, int)') [-Wincompatible-pointer-types]
      zend_execute_internal = hp_execute_internal;
                            ^ ~~~~~~~~~~~~~~~~~~~
/private/tmp/pear/install/xhprof/extension/xhprof.c:1903:25: warning: incompatible pointer types assigning to 'void (*)(zend_execute_data *, zval *)' (aka 'void (*)(struct _zend_execute_data *, struct _zval_struct *)') from 'void (*)(zend_execute_data *, struct _zend_fcall_info *, int)' (aka 'void (*)(struct _zend_execute_data *, struct _zend_fcall_info *, int)') [-Wincompatible-pointer-types]
  zend_execute_internal = _zend_execute_internal;
                        ^ ~~~~~~~~~~~~~~~~~~~~~~
/private/tmp/pear/install/xhprof/extension/xhprof.c:1930:15: error: no member named 'type' in 'struct _zval_struct'
  if (values->type == IS_ARRAY) {
      ~~~~~~  ^
/private/tmp/pear/install/xhprof/extension/xhprof.c:1936:33: error: too many arguments to function call, expected 2, have 4
    if (zend_hash_find(ht, key, len, (void**)&value) == SUCCESS) {
        ~~~~~~~~~~~~~~          ^~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/php70/7.0.6/include/php/Zend/zend_hash.h:154:1: note: 'zend_hash_find' declared here
ZEND_API zval* ZEND_FASTCALL zend_hash_find(const HashTable *ht, zend_string *key);
^
/usr/local/Cellar/php70/7.0.6/include/php/main/php_config.h:6:19: note: expanded from macro 'ZEND_API'
# define ZEND_API __attribute__ ((visibility("default")))
                  ^
/private/tmp/pear/install/xhprof/extension/xhprof.c:1960:15: error: no member named 'type' in 'struct _zval_struct'
  if (values->type == IS_ARRAY) {
      ~~~~~~  ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
12 warnings and 20 errors generated.
make: *** [xhprof.lo] Error 1
ERROR: `make' failed
lin-credible commented 8 years ago

I installed it well in CentOS.

......
Build process completed successfully
Installing '/usr/lib64/php/modules/xhprof.so'
install ok: channel://pecl.php.net/xhprof-0.9.4
configuration option "php_ini" is not set to php.ini location
You should add "extension=xhprof.so" to php.ini
[root@taolr ~]# php -v
PHP 5.3.3 (cli) (built: Feb  9 2016 10:36:17) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
[root@taolr ~]# cat /etc/issue
CentOS release 6.7 (Final)
Kernel \r on an \m

πŸ‘Œ

routerpipe commented 8 years ago

this version can't support php7

shyandsy commented 7 years ago

@routerpipe Are there any version support php7?

lin-credible commented 7 years ago

@routerpipe +1

HeathNaylor commented 7 years ago

Any news on PHP7 version?

dchaykas commented 7 years ago

Any further development to support 7.0.6?

longxinH commented 7 years ago

https://github.com/longxinH/xhprof php7 support

leemem commented 7 years ago

@longxinH Thank you very much, it work for me.

zoonman commented 5 years ago

@phacility could you please backport changes from https://github.com/longxinH/xhprof ? There are other projects depending on your repository, e.g.: https://trac.macports.org/ticket/57340

I tried building longxinH's extension under El Capitan and it did the work for me except it fails with Drupal. Provided sample.php worked for me flawlessly. I would assume there is something within Drupal or some conflict with xdebug.

epriestley commented 5 years ago

https://secure.phabricator.com/T9805