Bug #73111 [Opn]: make prof-use don't work -> still profiling code

From: Date: Mon, 19 Sep 2016 11:49:36 +0000
Subject: Bug #73111 [Opn]: make prof-use don't work -> still profiling code
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204124@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73111&edit=1

 ID:                 73111
 Updated by:         nikic@php.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.11
 Block user comment: N
 Private report:     N

 New Comment:

Without having looked into it, I suspect that the error you got in your last comment is because
--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. It will likely work if you run the whole thing (including profile generation) a second time.


Previous Comments:
------------------------------------------------------------------------
[2016-09-19 11:43:31] spam2 at rhsoft dot net

"make --always-make" seems to help partially

echo "PROFILE-GUIDED-OPTIMIZATION: Stage 1"
make %{?_smp_mflags} prof-gen
/rpmbuild/PHP-PGO/profile.sh $PWD
echo "PROFILE-GUIDED-OPTIMIZATION: Stage 2"
make --always-make %{?_smp_mflags} prof-use

but:

Zend/zend_language_scanner.l:2406:1: error: the control flow of function 'lex_scan' does
not match its profile data (counter 'indirect_call') [-Werror=coverage-mismatch]
Zend/zend_language_scanner.l:2406:1: error: the control flow of function 'lex_scan' does
not match its profile data (counter 'time_profiler') [-Werror=coverage-mismatch]
cc1: some warnings being treated as errors
Makefile:1721: recipe for target 'Zend/zend_ini_scanner.lo' failed
make[1]: *** [Zend/zend_ini_scanner.lo] Error 1
cc1: some warnings being treated as errors
Makefile:1717: recipe for target 'Zend/zend_language_scanner.lo' failed
make[1]: *** [Zend/zend_language_scanner.lo] Error 1
make[1]: Leaving directory '/home/builduser/rpmbuild/BUILD/php-7.0.11'
Makefile:302: recipe for target 'prof-use' failed
make: *** [prof-use] Error 2
Fehler: Fehler-Status beim Beenden von /var/tmp/rpm-tmp.1UuVW4 (%build)

------------------------------------------------------------------------
[2016-09-19 08:21:56] spam2 at rhsoft dot net

Description:
------------
make prof-gen
make test
make prof-use

the "make prof-use" just takes a second while i would expect a full compile using the
gcda-files filled with informations wude running "make test" and that part works becuase
while "make test" is running the timestamps of that files are changing

after that there is still the profiling code in the binaries because running it on another machine
at httpd startup you see these messages in the apache-errorlog

profiling:/home/builduser/rpmbuild/BUILD/php-7.0.11/ext/zlib/.libs/zlib.gcda:Skip
profiling:/home/builduser:Cannot create directory
profiling:/home/builduser/rpmbuild/BUILD/php-7.0.11/ext/pcre/.libs/php_pcre.gcda:Skip
profiling:/home/builduser:Cannot create directory
profiling:/home/builduser/rpmbuild/BUILD/php-7.0.11/ext/libxml/.libs/libxml.gcda:Skip
profiling:/home/builduser:Cannot create directory
profiling:/home/builduser/rpmbuild/BUILD/php-7.0.11/ext/date/lib/.libs/interval.gcda:Skip
profiling:/home/builduser:Cannot create directory
profiling:/home/builduser/rpmbuild/BUILD/php-7.0.11/ext/date/lib/.libs/parse_iso_intervals.gcda:Skip
profiling:/home/builduser:Cannot create directory
profiling:/home/builduser/rpmbuild/BUILD/php-7.0.11/ext/date/lib/.libs/unixtime2tm.gcda:Skip
profiling:/home/builduser:Cannot create directory
profiling:/home/builduser/rpmbuild/BUILD/php-7.0.11/ext/date/lib/.libs/tm2unixtime.gcda:Skip
profiling:/home/builduser:Cannot create directory
profiling:/home/builduser/rpmbuild/BUILD/php-7.0.11/ext/date/lib/.libs/timelib.gcda:Skip
profiling:/home/builduser:Cannot create directory
profiling:/home/builduser/rpmbuild/BUILD/php-7.0.11/ext/date/lib/.libs/parse_tz.gcda:Skip
profiling:/home/builduser:Cannot create directory
profiling:/home/builduser/rpmbuild/BUILD/php-7.0.11/ext/date/lib/.libs/parse_date.gcda:Skip
profiling:/home/builduser:Cannot create directory
profiling:/home/builduser/rpmbuild/BUILD/php-7.0.11/ext/date/lib/.libs/dow.gcda:Skip
profiling:/home/builduser:Cannot create directory
profiling:/home/builduser/rpmbuild/BUILD/php-7.0.11/ext/date/lib/.libs/astro.gcda:Skip
profiling:/home/builduser:Cannot create directory
profiling:/home/builduser/rpmbuild/BUILD/php-7.0.11/ext/date/.libs/php_date.gcda:Ski

Test script:
---------------
make prof-gen
make test
make prof-use

yes, i know that "make test" is probably not the best thing for PGO but a good start to
get the build-process implemented and then replace it with running custom php-code and "make
test" at the end with the final build

Expected result:
----------------
a final PGO build without the profiling code

Actual result:
--------------
binaries which stil contain profiling code after "make prof-use"


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=73111&edit=1


Thread (15 messages)

« previous php.bugs (#204124) next »