Skip to content

Commit e1f9d34

Browse files
committed
hide debug info by default
1 parent cdf6b58 commit e1f9d34

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

Zend/zend_execute_API.c

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,13 @@ void init_executor(void) /* {{{ */
188188
sev.sigev_signo = SIGIO;
189189
sev.sigev_notify_thread_id = (pid_t) syscall(SYS_gettid);
190190

191-
if (timer_create(CLOCK_THREAD_CPUTIME_ID, &sev, &EG(timer)) != 0)
192-
fprintf(stderr, "error %d while creating timer on thread %d\n", errno, (pid_t) syscall(SYS_gettid));
191+
if (timer_create(CLOCK_THREAD_CPUTIME_ID, &sev, &EG(timer)) != 0) {
193192
# ifdef TIMER_DEBUG
194-
else fprintf(stderr, "timer created on thread %d\n", syscall(SYS_gettid));
193+
fprintf(stderr, "error %d while creating timer %#jx on thread %d\n", errno, (uintmax_t) EG(timer), (pid_t) syscall(SYS_gettid));
194+
# endif
195+
}
196+
# ifdef TIMER_DEBUG
197+
else fprintf(stderr, "timer %#jx created on thread %d\n", (uintmax_t) EG(timer), syscall(SYS_gettid));
195198
# endif
196199
#endif
197200

@@ -421,10 +424,13 @@ void shutdown_executor(void) /* {{{ */
421424
#endif
422425

423426
#if defined(ZTS) && defined(HAVE_TIMER_CREATE)
424-
if (timer_delete(EG(timer)) != 0)
425-
fprintf(stderr, "error %d while deleting timer on thread %d\n", errno, (pid_t) syscall(SYS_gettid));
427+
if (timer_delete(EG(timer)) != 0) {
428+
# ifdef TIMER_DEBUG
429+
fprintf(stderr, "error %d while deleting timer %#jx on thread %d\n", errno, (uintmax_t) EG(timer), (pid_t) syscall(SYS_gettid));
430+
# endif
431+
}
426432
# ifdef TIMER_DEBUG
427-
else fprintf(stderr, "timer deleted on thread %d\n", (pid_t) syscall(SYS_gettid));
433+
else fprintf(stderr, "timer %#jx deleted on thread %d\n", (uintmax_t) EG(timer), (pid_t) syscall(SYS_gettid));
428434
# endif
429435
#endif
430436

@@ -1350,7 +1356,9 @@ ZEND_API ZEND_NORETURN void ZEND_FASTCALL zend_timeout(void) /* {{{ */
13501356
static void zend_timeout_handler(int dummy, siginfo_t *si, void *uc) /* {{{ */
13511357
{
13521358
if (si->si_value.sival_ptr != &EG(timer)) {
1359+
#ifdef TIMER_DEBUG
13531360
fprintf(stderr, "ignoring timeout signal SIGIO received on thread %d\n", (pid_t) syscall(SYS_gettid));
1361+
#endif
13541362

13551363
return;
13561364
}
@@ -1467,12 +1475,14 @@ static void zend_set_timeout_ex(zend_long seconds, bool reset_signals) /* {{{ */
14671475
its.it_interval.tv_nsec = 0;
14681476

14691477
if (timer_settime(timer, 0, &its, NULL) != 0) {
1470-
fprintf(stderr, "unable to set timer on thread %d\n", (pid_t) syscall(SYS_gettid));
1478+
#ifdef TIMER_DEBUG
1479+
fprintf(stderr, "unable to set timer %#jx on thread %d\n", (uintmax_t) timer, (pid_t) syscall(SYS_gettid));
1480+
#endif
14711481

14721482
return;
14731483
}
14741484
# ifdef TIMER_DEBUG
1475-
else fprintf(stderr, "timer set on thread %d (%ld seconds)\n", (pid_t) syscall(SYS_gettid), seconds);
1485+
else fprintf(stderr, "timer %#jx set on thread %d (%ld seconds)\n", (uintmax_t) timer, (pid_t) syscall(SYS_gettid), seconds);
14761486
# endif
14771487

14781488
if (reset_signals) {

0 commit comments

Comments
 (0)