A trace is a linear sequence of instructions with a single entry point and one or more exit points. A trace does not contain any inner control-flow join points execution either continues on the trace or it exits the trace.
先简单写个函数调用的PHP脚本add.php,然后去GDB调试,gdb ./sapi/cli/php, run -c php.ini add.php 先看看这个call stack
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
bt #0 zend_jit_setup_hot_trace_counters (op_array=0x7fffb4cdb4e0) at ext/opcache/jit/zend_jit_trace.c:8069 #1 0x00007ffff54d1c96 in zend_jit_op_array (op_array=0x7fffb4cdb4e0, script=0x7fffb4cdb280) at /home/wxue/wxue/php-src/ext/opcache/jit/zend_jit.c:4512 #2 0x00007ffff53bec59 in zend_persist_op_array (zv=0x7fffb4cdb4c0) at /home/wxue/wxue/php-src/ext/opcache/zend_persist.c:700 #3 0x00007ffff53c3ac0 in zend_accel_script_persist (script=0x7fffb4cdb280, for_shm=0x1) at /home/wxue/wxue/php-src/ext/opcache/zend_persist.c:1320 #4 0x00007ffff53acc50 in cache_script_in_shared_memory (new_persistent_script=0x7ffff5879000, key=0x7ffff55100b8 <accel_globals+408>, from_shared_memory=0x7fffffffa9a0) at /home/wxue/wxue/php-src/ext/opcache/ZendAccelerator.c:1600 #5 0x00007ffff53aea8f in persistent_compile_file (file_handle=0x7fffffffd000, type=0x8) at /home/wxue/wxue/php-src/ext/opcache/ZendAccelerator.c:2169 #6 0x0000555555c21c7c in zend_execute_scripts (type=0x8, retval=0x0, file_count=0x3) at /home/wxue/wxue/php-src/Zend/zend.c:1754 #7 0x0000555555b7ec84 in php_execute_script (primary_file=0x7fffffffd000) at /home/wxue/wxue/php-src/main/main.c:2538 #8 0x0000555555d97b5d in do_cli (argc=0x4, argv=0x555556b8dc10) at /home/wxue/wxue/php-src/sapi/cli/php_cli.c:965 #9 0x0000555555d98c65 in main (argc=0x4, argv=0x555556b8dc10) at /home/wxue/wxue/php-src/sapi/cli/php_cli.c:1367