php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #69744
Patch patch.txt revision 2017-06-16 05:48 UTC by jc at unternet dot net

Patch patch.txt for xhprof Bug #69744

Patch version 2017-06-16 05:48 UTC

Return to Bug #69744 | Download this patch
Patch Revisions:

Developer: jc@unternet.net

diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..f59af99
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,6 @@
+all:
+	cd extension && phpize
+	cd extension && ./configure
+	cd extension && $(MAKE)
+	cd extension && sudo $(MAKE) install
+	cd extension && $(MAKE) test
diff --git a/README b/README
index a8c15fa..09c21db 100644
--- a/README
+++ b/README
@@ -1,4 +1,12 @@
-For installation and usage notes refer to:
+NOTE: This version of xhprof will not compile under PHP7. It is known to work
+on PHP5.6. On an Ubuntu system, follow the advice given at
+https://askubuntu.com/a/756901/135108, i.e.:
+
+sudo add-apt-repository ppa:ondrej/php
+sudo apt-get update
+sudo apt-get install php5.6-dev
+
+For other installation and usage notes refer to:
    xhprof_html/docs/index.html
 
 To view the latest version of the doc, go to:
diff --git a/extension/xhprof.c b/extension/xhprof.c
index 66aa041..2bcc2e4 100644
--- a/extension/xhprof.c
+++ b/extension/xhprof.c
@@ -1232,7 +1232,18 @@ void hp_sample_check(hp_entry_t **entries  TSRMLS_DC) {
 static inline uint64 cycle_timer() {
   uint32 __a,__d;
   uint64 val;
+  #ifdef _ARCH_PPC64
+  asm volatile(
+    "0: mftbu %0\n\t"
+    "   mftb %1\n\t"
+    "   mftbu 0\n\t"
+    "   cmpw %0,0\n\t"
+    "   bne 0b\n\t"
+    : "=r" (__d), "=r" (__a)
+    : : "r0", "cc");
+  #else
   asm volatile("rdtsc" : "=a" (__a), "=d" (__d));
+  #endif
   (val) = ((uint64)__a) | (((uint64)__d)<<32);
   return val;
 }
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 13:01:31 2024 UTC