Skip to content

Conversation

arnaud-lb
Copy link
Member

This shows the filename/lineno where zend_jit_trace_get_exit_point() was called in zend_jit_dump_exit_info(), in debug builds:

---- TRACE 95 exit info
     exit_0: 0025/0000/7 CV2($flags):array CV3($i):int CV4($k):int X6:int ext/opcache/jit/zend_jit_ir.c:16857
     exit_1: 0028/0007/7 CV2($flags):array CV3($i):int CV4($k):int X6:int ext/opcache/jit/zend_jit_trace.c:5432
     exit_2: 0004/0014/7/VM CV1($count):int CV2($flags):array CV3($i):int CV4($k):int X6:int ext/opcache/jit/zend_jit_ir.c:8516
     exit_3: 0008/0021/7/VM CV1($count):int CV2($flags):array CV3($i):int CV4($k):int X6:int ext/opcache/jit/zend_jit_ir.c:10692

This is quite useful, since the dump doesn't generally allows to find where an exit point was created:

  • The opnum refers to the exit opline, not the one that generated the exit point
  • A single op may generate multiple exit points

@arnaud-lb arnaud-lb marked this pull request as ready for review September 4, 2025 13:31
@arnaud-lb arnaud-lb requested a review from dstogov as a code owner September 4, 2025 13:31
Copy link
Member

@dstogov dstogov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't like to merge this information into trace dumps.
It doesn't reflect the properties of the trace, just very specific implementation details.
I think, this may be done under the special debug flag disabled by default.

@arnaud-lb
Copy link
Member Author

@dstogov I've made the change to collect the filename/lineno only when ZEND_JIT_DEBUG_TRACE_EXIT_INFO is set.

I find this very useful when debugging, as it's difficult to find where an exit point was created in some cases.

@arnaud-lb arnaud-lb requested a review from a team September 15, 2025 09:52
Copy link
Member

@DanielEScherzer DanielEScherzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RM approval, technical review not performed
If I understand correctly this adds a new flag for JIT debugging, can you document that in the UPGRADING file?

@arnaud-lb
Copy link
Member Author

Unfortunately I missed the notification, so it will not be in 8.5. Not a big issue. I will document the new flag in UPGRADING 👍

@arnaud-lb arnaud-lb closed this in 0d4ff66 Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants