gajus / xhprof.io

GUI to analyze the profiling data collected using XHProf – A Hierarchical Profiler for PHP.
http://xhprof.io/
Other
429 stars 103 forks source link

make fails (impossible constraint in 'asm') on synology DS211j #50

Closed virtual7 closed 11 years ago

virtual7 commented 11 years ago

$ pear install --force pecl/xhprof WARNING: failed to download pecl.php.net/xhprof within preferred state "stable", will instead download version 0.9.3, stability "beta" WARNING: channel "pecl.php.net" has updated its protocols, use "pear channel-update pecl.php.net" to update downloading xhprof-0.9.3.tgz ... Starting to download xhprof-0.9.3.tgz (841,836 bytes) .....................................done: 841,836 bytes 11 source files, building running: phpize Configuring for: PHP Api Version: 20041225 Zend Module Api No: 20060613 Zend Extension Api No: 220060519 configure.in:3: warning: prefer named diversions configure.in:3: warning: prefer named diversions building in /opt/tmp/pear/temp/pear-build-rootxkPzBv/xhprof-0.9.3 running: /opt/tmp/pear/temp/xhprof/extension/configure 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... /opt/bin/sed checking for cc... no checking for gcc... gcc 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 gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking how to run the C preprocessor... gcc -E checking for icc... no checking for suncc... no checking whether gcc and cc understand -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... armv5tel-unknown-linux-gnu checking host system type... armv5tel-unknown-linux-gnu checking target system type... armv5tel-unknown-linux-gnu checking for PHP prefix... /opt checking for PHP includes... -I/opt/include/php -I/opt/include/php/main -I/opt/include/php/TSRM -I/opt/include/php/Zend -I/opt/include/php/ext -I/opt/include/php/ext/date/lib checking for PHP extension directory... /opt/lib/php/extensions checking for PHP installed headers prefix... /opt/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 xhprof support... yes, shared checking for ld used by gcc... /opt/arm-none-linux-gnueabi/bin/ld checking if the linker (/opt/arm-none-linux-gnueabi/bin/ld) is GNU ld... yes checking for /opt/arm-none-linux-gnueabi/bin/ld option to reload object files... -r checking for BSD-compatible nm... /opt/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... 32768 checking command to parse /opt/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... no checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/opt/arm-none-linux-gnueabi/bin/ld) 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 running: make /opt/bin/bash /opt/tmp/pear/temp/pear-build-rootxkPzBv/xhprof-0.9.3/libtool --mode=compile gcc -I. -I/opt/tmp/pear/temp/xhprof/extension -DPHP_ATOM_INC -I/opt/tmp/pear/temp/pear-build-rootxkPzBv/xhprof-0.9.3/include -I/opt/tmp/pear/temp/pear-build-rootxkPzBv/xhprof-0.9.3/main -I/opt/tmp/pear/temp/xhprof/extension -I/opt/include/php -I/opt/include/php/main -I/opt/include/php/TSRM -I/opt/include/php/Zend -I/opt/include/php/ext -I/opt/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /opt/tmp/pear/temp/xhprof/extension/xhprof.c -o xhprof.lo mkdir .libs gcc -I. -I/opt/tmp/pear/temp/xhprof/extension -DPHP_ATOM_INC -I/opt/tmp/pear/temp/pear-build-rootxkPzBv/xhprof-0.9.3/include -I/opt/tmp/pear/temp/pear-build-rootxkPzBv/xhprof-0.9.3/main -I/opt/tmp/pear/temp/xhprof/extension -I/opt/include/php -I/opt/include/php/main -I/opt/include/php/TSRM -I/opt/include/php/Zend -I/opt/include/php/ext -I/opt/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /opt/tmp/pear/temp/xhprof/extension/xhprof.c -fPIC -DPIC -o .libs/xhprof.o /opt/tmp/pear/temp/xhprof/extension/xhprof.c: In function 'hp_init_profiler_state': /opt/tmp/pear/temp/xhprof/extension/xhprof.c:1224: error: impossible constraint in 'asm' /opt/tmp/pear/temp/xhprof/extension/xhprof.c:1224: error: impossible constraint in 'asm' make: * [xhprof.lo] Error 1 ERROR: `make' failed $ make make: * No targets specified and no makefile found. Stop.

staabm commented 11 years ago

This is not the correct bugtracker for xhprof bug reports

virtual7 commented 11 years ago

Sorry. PEAR Version: 1.9.4 PHP Version: 5.2.17 Zend Engine Version: 2.2.0 Running on: Linux DiskStation 2.6.32.12 #3211 Tue Apr 16 20:03:28 CST 2013 armv5tel Apache 2.0 What else should I provide? Thank you.

gajus commented 11 years ago

Hi @virtual7, you should report this to https://github.com/facebook/xhprof.

virtual7 commented 11 years ago

I tried, but there is no "Issues" menu. How can I submit a bug? Thank you.

oerdnj commented 8 years ago

Google led me here, so if anybody is still looking for a XHProf for ARM then here's working patch:

From: =?utf-8?q?Ond=C5=99ej_Sur=C3=BD?= <ondrej@sury.org>
Date: Fri, 13 May 2016 10:06:39 +0200
Subject: Don't use rdtsc on arm*

---
 xhprof-0.9.4/extension/xhprof.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/xhprof-0.9.4/extension/xhprof.c b/xhprof-0.9.4/extension/xhprof.c
index a053ede..c275d48 100644
--- a/xhprof-0.9.4/extension/xhprof.c
+++ b/xhprof-0.9.4/extension/xhprof.c
@@ -1219,10 +1219,18 @@ void hp_sample_check(hp_entry_t **entries  TSRMLS_DC) {
  * @author cjiang
  */
 inline uint64 cycle_timer() {
-  uint32 __a,__d;
   uint64 val;
+#if defined(__arm__) || defined(__aarch64__)
+  struct timespec ts;
+  clock_gettime(CLOCK_REALTIME, &ts);
+  val = ts.tv_sec;
+  val = val * 1000000000ULL;
+  val += ts.tv_nsec;
+#else
+  uint32 __a,__d;
   asm volatile("rdtsc" : "=a" (__a), "=d" (__d));
   (val) = ((uint64)__a) | (((uint64)__d)<<32);
+#endif
   return val;
 }