Edit report at https://bugs.php.net/bug.php?id=73111&edit=1
ID: 73111
User updated by: spam2 at rhsoft dot net
Reported by: spam2 at rhsoft dot net
Summary: make prof-use don't work -> still profiling code
Status: Open
Type: Bug
Package: Compile Failure
Operating System: Linux
PHP Version: 7.0.12 RC1
Block user comment: N
Private report: N
New Comment:
probably, but on the other hand "make prof-use" without "make prof-gen" before
don't make any sense and the same for missing "make prop-clean" after running sample
scripts, hence "make prop-clean" should be implicit
additional you can't fix all the other references not mentioning "make prof-clean"
while i wonder how they all pretend to got a sucessful build r did they just imagine optimization
and not realize that their final binary still contains the profiling code and spits in logs all day
long?
https://software.intel.com/en-us/blogs/2015/10/09/pgo-let-it-go-phphttp://www.phpclasses.org/blog/post/321-PHP-7-Performance-Improvements-May-Increase-if-You-Optimize-it-to-Your-Application-using-to-PGO.html
Previous Comments:
------------------------------------------------------------------------
[2016-09-30 01:10:04] yohgaki@php.net
Make this a doc issue?
This page might be the page.
http://jp2.php.net/manual/en/faq.build.php
------------------------------------------------------------------------
[2016-09-29 23:15:34] spam2 at rhsoft dot net
back at home - that sequence works:
________________________________________
make %{?_smp_mflags} prof-gen
/usr/bin/bash /rpmbuild/PHP-PGO/profile.sh $PWD
make prof-clean
make %{?_smp_mflags} prof-use
________________________________________
the size difference of the resulting binaries with no other changes is dramatically
-rwxr-xr-x 1 root root 5,8M 2016-09-29 17:20 /usr/bin/php
-rwxr-xr-x 1 root root 4,9M 2016-09-29 18:19 /usr/bin/php
________________________________________
after thinking again about "--always-make forces a regeneration of the lexer and you have a
different re2c version installed which was used to generate the lexer in the repo, so you end up
with minor differences in control flow" i tried ot add "--always-make" to the
"make prof-gen" call
that seems to make some differnce BUT the reduced binary size is completly gone (retried 2 times,
with --always-make only in the first and also in both calls)
it's not really related to this bugreport, but given that bison/re2c are seem to do something
but the binaries end as large as with the missing "make prof-clean" maybe it's better
to leave --always-make completly out of the game
+/home/builduser/rpmbuild/BUILD/php-7.0.12/Zend/zend_ini_parser.y:264.1-12: warning: deprecated
directive, use '%pure-parser' [-Wdeprecated]
+ %pure_parser
+ ^^^^^^^^^+bison -y --defines -l /home/builduser/rpmbuild/BUILD/php-7.0.12/ext/json/json_parser.y
-o /home/builduser/rpmbuild/BUILD/php-7.0.12/ext/json/json_parser.tab.c^^^
------------------------------------------------------------------------
[2016-09-29 17:14:52] spam2 at rhsoft dot net
That indeed seems to work, but when you Google for build php with pgo "make prof-clean" is
nowhere (Intel pages and others) mentioned and looking at the rm-calls it's pretty obvious that
"make prof-use" should fire them implicit
------------------------------------------------------------------------
[2016-09-29 15:54:44] nikic@php.net
Just checked the makefile, it seems pretty clear that the intended command sequence is
make prof-gen
# train
make prof-clean
make prof-use
Your invocation is missing the "make prof-clean", which is what removes the compiler
artifacts so that "make prof-use" will actually recompile.
------------------------------------------------------------------------
[2016-09-29 14:59:37] spam2 at rhsoft dot net
7.0.12 RC1 does the same nonsense and skip the "make -j8 prof-use" completly which leads
in steop over to "make install" and in fact installs binaries with the profile-code
leading in overhead error messages at runtime without the "--always-make" hack
______________________________________
./configure
make -j8 prof-gen
<run application code>
make -j8 prof-use
make install
______________________________________
+ make -j8 prof-use
CCACHE_DISABLE=1 make PROF_FLAGS=-fprofile-use all
make[1]: Entering directory '/home/builduser/rpmbuild/BUILD/php-7.0.12'
Build complete.
Don't forget to run 'make test'.
make[1]: Leaving directory '/home/builduser/rpmbuild/BUILD/php-7.0.12'
+ exit 0
Ausführung(%install): /bin/sh -e /var/tmp/rpm-tmp.F1EgEt
+ umask 022
+ cd /home/builduser/rpmbuild/BUILD
+ '[' /home/builduser/rpmbuild/BUILDROOT/php-7.0.12-1.fc24.20160929.1647.rh.x86_64
'!=' / ']'
+ rm -rf /home/builduser/rpmbuild/BUILDROOT/php-7.0.12-1.fc24.20160929.1647.rh.x86_64
++ dirname /home/builduser/rpmbuild/BUILDROOT/php-7.0.12-1.fc24.20160929.1647.rh.x86_64
+ mkdir -p /home/builduser/rpmbuild/BUILDROOT
+ mkdir /home/builduser/rpmbuild/BUILDROOT/php-7.0.12-1.fc24.20160929.1647.rh.x86_64
+ cd php-7.0.12
+ install -m 0755 -d
/home/builduser/rpmbuild/BUILDROOT/php-7.0.12-1.fc24.20160929.1647.rh.x86_64/etc
/home/builduser/rpmbuild/BUILDROOT/php-7.0.12-1.fc24.20160929.1647.rh.x86_64/etc/httpd/conf
/home/builduser/rpmbuild/BUILDROOT/php-7.0.12-1.fc24.20160929.1647.rh.x86_64/usr/lib64/httpd/modules
/home/builduser/rpmbuild/BUILDROOT/php-7.0.12-1.fc24.20160929.1647.rh.x86_64/usr/share/php
+ install -m 0644 /home/builduser/rpmbuild/SOURCES/opcache-zendoptimizer.php
/home/builduser/rpmbuild/BUILDROOT/php-7.0.12-1.fc24.20160929.1647.rh.x86_64/usr/share/php/zendoptimizer.php
+ install -m 0644 /home/builduser/rpmbuild/SOURCES/php-httpd-dummy.conf
/home/builduser/rpmbuild/BUILDROOT/php-7.0.12-1.fc24.20160929.1647.rh.x86_64/etc/httpd/conf/httpd.conf
+ INSTALL_ROOT=/home/builduser/rpmbuild/BUILDROOT/php-7.0.12-1.fc24.20160929.1647.rh.x86_64
+ make install
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=73111
--
Edit this bug report at https://bugs.php.net/bug.php?id=73111&edit=1