Skip to content

Commit 098d9ca

Browse files
danogiluuu1994
authored andcommittedOct 3, 2023
Trigger JIT tracing&compilation more often
Closes GH-12250
1 parent 2491592 commit 098d9ca

File tree

7 files changed

+51
-19
lines changed

7 files changed

+51
-19
lines changed
 

‎.cirrus.yml

+9-2
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ arm_task:
204204
sapi/cli/php run-tests.php
205205
-d zend_extension=opcache.so
206206
-d opcache.enable_cli=1
207-
-d opcache.jit_buffer_size=16M
207+
-d opcache.jit_buffer_size=64M
208208
-d opcache.jit=function
209209
-P -q -x -j2
210210
-g FAIL,BORK,LEAK,XLEAK
@@ -217,7 +217,14 @@ arm_task:
217217
sapi/cli/php run-tests.php
218218
-d zend_extension=opcache.so
219219
-d opcache.enable_cli=1
220-
-d opcache.jit_buffer_size=16M
220+
-d opcache.jit_buffer_size=64M
221+
-d opcache.jit_max_root_traces=1000000
222+
-d opcache.jit_max_side_traces=1000000
223+
-d opcache.jit_max_exit_counters=1000000
224+
-d opcache.jit_hot_loop=1
225+
-d opcache.jit_hot_func=1
226+
-d opcache.jit_hot_return=1
227+
-d opcache.jit_hot_side_exit=1
221228
-d opcache.jit=tracing
222229
-P -q -x -j2
223230
-g FAIL,BORK,LEAK,XLEAK

‎.github/actions/test-linux/action.yml

+13
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ inputs:
66
runTestsParameters:
77
default: ''
88
required: false
9+
jitType:
10+
default: 'disable'
11+
required: false
912
runs:
1013
using: composite
1114
steps:
@@ -38,6 +41,16 @@ runs:
3841
export TEST_PHP_JUNIT=junit.out.xml
3942
export STACK_LIMIT_DEFAULTS_CHECK=1
4043
sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
44+
-d opcache.jit=${{ inputs.jitType }} \
45+
-d opcache.protect_memory=1 \
46+
-d opcache.jit_buffer_size=64M \
47+
-d opcache.jit_max_root_traces=1000000 \
48+
-d opcache.jit_max_side_traces=1000000 \
49+
-d opcache.jit_max_exit_counters=1000000 \
50+
-d opcache.jit_hot_loop=1 \
51+
-d opcache.jit_hot_func=1 \
52+
-d opcache.jit_hot_return=1 \
53+
-d opcache.jit_hot_side_exit=1 \
4154
-j$(/usr/bin/nproc) \
4255
-g FAIL,BORK,LEAK,XLEAK \
4356
--no-progress \

‎.github/actions/test-macos/action.yml

+9
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ runs:
1717
export TEST_PHP_JUNIT=junit.out.xml
1818
export STACK_LIMIT_DEFAULTS_CHECK=1
1919
sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
20+
-d opcache.protect_memory=1 \
21+
-d opcache.jit_buffer_size=64M \
22+
-d opcache.jit_max_root_traces=1000000 \
23+
-d opcache.jit_max_side_traces=1000000 \
24+
-d opcache.jit_max_exit_counters=1000000 \
25+
-d opcache.jit_hot_loop=1 \
26+
-d opcache.jit_hot_func=1 \
27+
-d opcache.jit_hot_return=1 \
28+
-d opcache.jit_hot_side_exit=1 \
2029
-j$(sysctl -n hw.ncpu) \
2130
-g FAIL,BORK,LEAK,XLEAK \
2231
--no-progress \

‎.github/scripts/windows/test_task.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ set OPENSSL_CONF=
8484
rem set SSLEAY_CONF=
8585

8686
rem prepare for OPcache
87-
if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=16M
87+
if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=64M -d opcache.jit_max_root_traces=1000000 -d opcache.jit_max_side_traces=1000000 -d opcache.jit_max_exit_counters=1000000 -d opcache.jit_hot_loop=1 -d opcache.jit_hot_func=1 -d opcache.jit_hot_return=1 -d opcache.jit_hot_side_exit=1 -d opcache.jit=tracing
8888
rem work-around for failing to dl(mysqli) with OPcache (https://github.com/php/php-src/issues/8508)
8989
if "%OPCACHE%" equ "1" set OPCACHE_OPTS=%OPCACHE_OPTS% -d extension=mysqli
9090

‎.github/workflows/nightly.yml

+16-12
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ jobs:
103103
uses: ./.github/actions/test-linux
104104
with:
105105
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT
106+
jitType: tracing
106107
runTestsParameters: >-
107108
${{ matrix.run_tests_parameters }}
108109
-d zend_extension=opcache.so
109110
-d opcache.enable_cli=1
110-
-d opcache.jit_buffer_size=16M
111111
- name: Test OpCache
112112
uses: ./.github/actions/test-linux
113113
with:
@@ -123,12 +123,11 @@ jobs:
123123
uses: ./.github/actions/test-linux
124124
with:
125125
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Function JIT
126+
jitType: function
126127
runTestsParameters: >-
127128
${{ matrix.run_tests_parameters }}
128129
-d zend_extension=opcache.so
129130
-d opcache.enable_cli=1
130-
-d opcache.jit_buffer_size=16M
131-
-d opcache.jit=1205
132131
- name: Verify generated files are up to date
133132
uses: ./.github/actions/verify-generated-files
134133
- name: Notify Slack
@@ -194,11 +193,11 @@ jobs:
194193
- name: Test Tracing JIT
195194
uses: ./.github/actions/test-linux
196195
with:
196+
jitType: tracing
197197
runTestsParameters: >-
198198
${{ matrix.run_tests_parameters }}
199199
-d zend_extension=opcache.so
200200
-d opcache.enable_cli=1
201-
-d opcache.jit_buffer_size=16M
202201
- name: Test OpCache
203202
uses: ./.github/actions/test-linux
204203
with:
@@ -209,12 +208,11 @@ jobs:
209208
- name: Test Function JIT
210209
uses: ./.github/actions/test-linux
211210
with:
211+
jitType: function
212212
runTestsParameters: >-
213213
${{ matrix.run_tests_parameters }}
214214
-d zend_extension=opcache.so
215215
-d opcache.enable_cli=1
216-
-d opcache.jit_buffer_size=16M
217-
-d opcache.jit=1205
218216
- name: Notify Slack
219217
if: failure()
220218
uses: ./.github/actions/notify-slack
@@ -258,29 +256,25 @@ jobs:
258256
uses: ./.github/actions/test-macos
259257
with:
260258
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT
259+
jitType: tracing
261260
runTestsParameters: >-
262261
-d zend_extension=opcache.so
263262
-d opcache.enable_cli=1
264-
-d opcache.protect_memory=1
265-
-d opcache.jit_buffer_size=16M
266263
- name: Test OpCache
267264
uses: ./.github/actions/test-macos
268265
with:
269266
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} OpCache
270267
runTestsParameters: >-
271268
-d zend_extension=opcache.so
272269
-d opcache.enable_cli=1
273-
-d opcache.protect_memory=1
274270
- name: Test Function JIT
275271
uses: ./.github/actions/test-macos
276272
with:
277273
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Function JIT
274+
jitType: function
278275
runTestsParameters: >-
279276
-d zend_extension=opcache.so
280277
-d opcache.enable_cli=1
281-
-d opcache.protect_memory=1
282-
-d opcache.jit_buffer_size=16M
283-
-d opcache.jit=1205
284278
- name: Verify generated files are up to date
285279
uses: ./.github/actions/verify-generated-files
286280
- name: Notify Slack
@@ -321,6 +315,7 @@ jobs:
321315
- name: Test OpCache
322316
uses: ./.github/actions/test-linux
323317
with:
318+
jitType: tracing
324319
runTestsParameters: >-
325320
-d zend_extension=opcache.so
326321
-d opcache.enable_cli=1
@@ -375,6 +370,15 @@ jobs:
375370
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
376371
echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini
377372
echo opcache.jit_buffer_size=1G >> /etc/php.d/opcache.ini
373+
echo opcache.jit_max_root_traces=1000000 >> /etc/php.d/opcache.ini
374+
echo opcache.jit_max_side_traces=1000000 >> /etc/php.d/opcache.ini
375+
echo opcache.jit_max_exit_counters=1000000 >> /etc/php.d/opcache.ini
376+
echo opcache.jit_hot_loop=1 >> /etc/php.d/opcache.ini
377+
echo opcache.jit_hot_func=1 >> /etc/php.d/opcache.ini
378+
echo opcache.jit_hot_return=1 >> /etc/php.d/opcache.ini
379+
echo opcache.jit_hot_side_exit=1 >> /etc/php.d/opcache.ini
380+
echo memory_limit=-1 >> /etc/php.d/opcache.ini
381+
php -v
378382
- name: Test AMPHP
379383
if: matrix.branch.ref != 'PHP-8.0'
380384
run: |

‎.github/workflows/push.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ jobs:
126126
uses: ./.github/actions/test-linux
127127
with:
128128
testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}_${{ matrix.asan && 'OpCache' || 'Tracing JIT' }}
129+
jitType: ${{ matrix.asan && 'disable' || 'tracing' }}
129130
runTestsParameters: >-
130131
-d zend_extension=opcache.so
131132
-d opcache.enable_cli=1
132-
${{ !matrix.asan && '-d opcache.jit_buffer_size=16M' || '' }}
133133
${{ matrix.asan && '--asan -x' || '' }}
134134
- name: Verify generated files are up to date
135135
if: ${{ !matrix.asan }}
@@ -160,11 +160,10 @@ jobs:
160160
uses: ./.github/actions/test-macos
161161
with:
162162
testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT
163+
jitType: tracing
163164
runTestsParameters: >-
164165
-d zend_extension=opcache.so
165166
-d opcache.enable_cli=1
166-
-d opcache.protect_memory=1
167-
-d opcache.jit_buffer_size=16M
168167
- name: Verify generated files are up to date
169168
uses: ./.github/actions/verify-generated-files
170169
WINDOWS:

‎.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ before_script:
8585

8686
# Run PHPs run-tests.php
8787
script:
88-
- travis_wait ./travis/test.sh -d opcache.jit_buffer_size=16M -d opcache.jit=tracing
88+
- travis_wait 60 ./travis/test.sh -d opcache.jit=tracing -d opcache.jit_buffer_size=64M -d opcache.jit_max_root_traces=1000000 -d opcache.jit_max_side_traces=1000000 -d opcache.jit_max_exit_counters=1000000 -d opcache.jit_hot_loop=1 -d opcache.jit_hot_func=1 -d opcache.jit_hot_return=1 -d opcache.jit_hot_side_exit=1
8989
- sapi/cli/php -d extension_dir=`pwd`/modules -r 'dl("zend_test");'
9090

9191
after_success:

0 commit comments

Comments
 (0)