Closed krzotr closed 8 months ago
Hey @krzotr,
Could you define a little more about there being "no information" on whether it's enabled or not.
When I have it enabled with the tracing
or function
value for opcache.jit
, it shows such as:
When I have it disabled with disable
or off
for opcache.jit
it shows such as:
If you want to turn off the graph, that's a separate value, part of the highlight
config setting you pass in to Service::__construct()
.
Hi @amnuts ,
From documentation: opcache.jit_buffer_size - The amount of shared memory to reserve for compiled JIT code. A zero value disables the JIT.
I enabled JIT by opcache.jit_buffer_size = 48M
in php.ini (all opcache.*
setting by default)
I was wondering why all the time jit buffer / free is empty. I checked error log. I had Xdebug enabled.
[21-Oct-2023 22:06:58] NOTICE: PHP message: PHP Warning: JIT is incompatible with third party extensions that override zend_execute_ex(). JIT disabled. in Unknown on line 0
There is no information in opcache-gui if JIT is enabled/disabled. If JIT is disabled jit buffer
information in the right menu is useless (all zeros). Directive opcache.jit
does mean JIT is enabled
Example:
var_dump(
opcache_get_configuration()['directives']['opcache.jit'],
opcache_get_status()['jit']['enabled']
);
opcache.jit_buffer_size = 48M
+ XDebug
string(7) "tracing"
bool(false) // JIT is disabled because Xdebug, correct
opcache.jit_buffer_size = 48M
+ disabled Xdebug
string(7) "tracing" bool(true) // JIT is enabled, correct
opcache.jit_buffer_size = 48M
+ opcache.jit = disable
string(7) "disable" bool(true) // JIT is disabled with directive opcache.jit = disable , correct
Default opcache.*
settings (opcache.jit_buffer_size = 0)
string(7) "tracing" bool(false) // JIT is disabled by default, correct
To get information if JIT is really enabled / disabled
we have to use opcache_get_status()['jit']['enabled']
If JIT is enabled (jit buffer 48MB / buffer free 47.99MB) everything looks fine
Thanks for that explanation, @krzotr, I get what you're saying now.
I've been looking at it from the opcache.jit
setting, and having that off or not, but that's not taking into account if opcache is being disabled by other means, like xdebug or not setting the memory limit. 👍
OK, I'll have a look into that. And it probably makes sense not to show the jit stuff if it's disabled, irrespective of the highlight setting, so I'll look into that, too.
@krzotr, this is now fixed and released.
Will now hide the JIT stats if it's disabled, and also show clearly if it's disabled or not:
JIT has been introduced in PHP 8.0. There is no information in
opcache-gui
if JIT is enabled or disabled. Even if JIT is disabled on the right side I seejit buffer
(Tested on 8.2.11)Fix: Condition should be
!empty($status['jit']['enabled'])
https://github.com/amnuts/opcache-gui/blob/edbcbbedd007dfd8b2bbf1f4f362ea4892738c41/index.php#L420
Is any way to add additional information for PHP >= 8.0 if JIT is Enabled/Disabled in
General info
tab?