Lines Matching refs:self

31 MYSQLND_METHOD(mysqlnd_debug, open)(MYSQLND_DEBUG * self, zend_bool reopen)  in MYSQLND_METHOD()
33 if (!self->file_name) { in MYSQLND_METHOD()
37 self->stream = php_stream_open_wrapper(self->file_name, in MYSQLND_METHOD()
38 reopen == TRUE || self->flags & MYSQLND_DEBUG_APPEND? "ab":"wb", in MYSQLND_METHOD()
40 return self->stream? PASS:FAIL; in MYSQLND_METHOD()
47 MYSQLND_METHOD(mysqlnd_debug, log)(MYSQLND_DEBUG * self, in MYSQLND_METHOD()
56 unsigned int flags = self->flags; in MYSQLND_METHOD()
60 if (!self->stream && FAIL == self->m->open(self, FALSE)) { in MYSQLND_METHOD()
65 level = zend_stack_count(&self->call_stack); in MYSQLND_METHOD()
76 snprintf(pid_buffer, sizeof(pid_buffer) - 1, "%5u: ", self->pid); in MYSQLND_METHOD()
129 ret = php_stream_write(self->stream, message_line, message_line_len)? PASS:FAIL; in MYSQLND_METHOD()
132 self->m->close(self); in MYSQLND_METHOD()
133 self->m->open(self, TRUE); in MYSQLND_METHOD()
142 MYSQLND_METHOD(mysqlnd_debug, log_va)(MYSQLND_DEBUG *self, in MYSQLND_METHOD()
153 unsigned int flags = self->flags; in MYSQLND_METHOD()
157 if (!self->stream && FAIL == self->m->open(self, FALSE)) { in MYSQLND_METHOD()
162 level = zend_stack_count(&self->call_stack); in MYSQLND_METHOD()
173 snprintf(pid_buffer, sizeof(pid_buffer) - 1, "%5u: ", self->pid); in MYSQLND_METHOD()
230 ret = php_stream_write(self->stream, message_line, message_line_len)? PASS:FAIL; in MYSQLND_METHOD()
234 self->m->close(self); in MYSQLND_METHOD()
235 self->m->open(self, TRUE); in MYSQLND_METHOD()
245 MYSQLND_METHOD(mysqlnd_debug, func_enter)(MYSQLND_DEBUG * self, in MYSQLND_METHOD()
249 if ((self->flags & MYSQLND_DEBUG_DUMP_TRACE) == 0 || self->file_name == NULL) { in MYSQLND_METHOD()
252 if ((uint32_t) zend_stack_count(&self->call_stack) >= self->nest_level_limit) { in MYSQLND_METHOD()
256 if ((self->flags & MYSQLND_DEBUG_TRACE_MEMORY_CALLS) == 0 && self->skip_functions) { in MYSQLND_METHOD()
257 const char ** p = self->skip_functions; in MYSQLND_METHOD()
260 zend_stack_push(&self->call_stack, &mysqlnd_debug_empty_string); in MYSQLND_METHOD()
262 if (self->flags & MYSQLND_DEBUG_PROFILE_CALLS) { in MYSQLND_METHOD()
264 zend_stack_push(&self->call_time_stack, &some_time); in MYSQLND_METHOD()
273 zend_stack_push(&self->call_stack, &func_name); in MYSQLND_METHOD()
275 if (self->flags & MYSQLND_DEBUG_PROFILE_CALLS) { in MYSQLND_METHOD()
277 zend_stack_push(&self->call_time_stack, &some_time); in MYSQLND_METHOD()
281 if (zend_hash_num_elements(&self->not_filtered_functions) && in MYSQLND_METHOD()
282 0 == zend_hash_str_exists(&self->not_filtered_functions, func_name, strlen(func_name))) in MYSQLND_METHOD()
287 self->m->log_va(self, line, file, zend_stack_count(&self->call_stack) - 1, NULL, ">%s", func_name); in MYSQLND_METHOD()
313 MYSQLND_METHOD(mysqlnd_debug, func_leave)(MYSQLND_DEBUG * self, unsigned int line, const char * con… in MYSQLND_METHOD()
318 zend_bool profile_calls = self->flags & MYSQLND_DEBUG_PROFILE_CALLS? TRUE:FALSE; in MYSQLND_METHOD()
320 if ((self->flags & MYSQLND_DEBUG_DUMP_TRACE) == 0 || self->file_name == NULL) { in MYSQLND_METHOD()
323 if ((uint32_t) zend_stack_count(&self->call_stack) >= self->nest_level_limit) { in MYSQLND_METHOD()
327 func_name = zend_stack_top(&self->call_stack); in MYSQLND_METHOD()
331 mine_non_own_time_ptr = zend_stack_top(&self->call_time_stack); in MYSQLND_METHOD()
333 zend_stack_del_top(&self->call_time_stack); /* callee - removing ourselves */ in MYSQLND_METHOD()
339 } else if (!zend_hash_num_elements(&self->not_filtered_functions) || in MYSQLND_METHOD()
340 1 == zend_hash_str_exists(&self->not_filtered_functions, (*func_name), strlen((*func_name)))) in MYSQLND_METHOD()
345self->m->log_va(self, line, file, zend_stack_count(&self->call_stack) - 1, NULL, "<%s", *func_name… in MYSQLND_METHOD()
354self->m->log_va(self, line, file, zend_stack_count(&self->call_stack) - 1, NULL, "<%s (total=%u ow… in MYSQLND_METHOD()
358 …if ((f_profile = zend_hash_str_find_ptr(&self->function_profiles, *func_name, func_name_len)) != N… in MYSQLND_METHOD()
402 …zend_hash_str_add_mem(&self->function_profiles, *func_name, func_name_len, f_profile, sizeof(struc… in MYSQLND_METHOD()
404 if ((uint32_t) zend_stack_count(&self->call_time_stack)) { in MYSQLND_METHOD()
407 parent_non_own_time_ptr = zend_stack_top(&self->call_time_stack); in MYSQLND_METHOD()
410 zend_stack_del_top(&self->call_time_stack); /* the caller */ in MYSQLND_METHOD()
411 zend_stack_push(&self->call_time_stack, &parent_non_own_time); /* add back the caller */ in MYSQLND_METHOD()
417 return zend_stack_del_top(&self->call_stack) == SUCCESS? PASS:FAIL; in MYSQLND_METHOD()
424 MYSQLND_METHOD(mysqlnd_debug, close)(MYSQLND_DEBUG * self) in MYSQLND_METHOD()
426 if (self->stream) { in MYSQLND_METHOD()
428 if (!(self->flags & MYSQLND_DEBUG_FLUSH) && (self->flags & MYSQLND_DEBUG_PROFILE_CALLS)) { in MYSQLND_METHOD()
432 self->m->log_va(self, __LINE__, __FILE__, 0, "info : ", in MYSQLND_METHOD()
433 "number of functions: %d", zend_hash_num_elements(&self->function_profiles)); in MYSQLND_METHOD()
434 ZEND_HASH_FOREACH_STR_KEY_PTR(&self->function_profiles, string_key, f_profile) { in MYSQLND_METHOD()
435 self->m->log_va(self, __LINE__, __FILE__, -1, "info : ", in MYSQLND_METHOD()
460 php_stream_close(self->stream); in MYSQLND_METHOD()
461 self->stream = NULL; in MYSQLND_METHOD()
471 MYSQLND_METHOD(mysqlnd_debug, free)(MYSQLND_DEBUG * self) in MYSQLND_METHOD()
473 if (self->file_name && self->file_name != mysqlnd_debug_default_trace_file) { in MYSQLND_METHOD()
474 efree(self->file_name); in MYSQLND_METHOD()
475 self->file_name = NULL; in MYSQLND_METHOD()
477 zend_stack_destroy(&self->call_stack); in MYSQLND_METHOD()
478 zend_stack_destroy(&self->call_time_stack); in MYSQLND_METHOD()
479 zend_hash_destroy(&self->not_filtered_functions); in MYSQLND_METHOD()
480 zend_hash_destroy(&self->function_profiles); in MYSQLND_METHOD()
481 free(self); in MYSQLND_METHOD()
496 MYSQLND_METHOD(mysqlnd_debug, set_mode)(MYSQLND_DEBUG * self, const char * const mode) in MYSQLND_METHOD()
503 self->flags = 0; in MYSQLND_METHOD()
504 self->nest_level_limit = 0; in MYSQLND_METHOD()
505 if (self->file_name && self->file_name != mysqlnd_debug_default_trace_file) { in MYSQLND_METHOD()
506 efree(self->file_name); in MYSQLND_METHOD()
507 self->file_name = NULL; in MYSQLND_METHOD()
509 if (zend_hash_num_elements(&self->not_filtered_functions)) { in MYSQLND_METHOD()
510 zend_hash_destroy(&self->not_filtered_functions); in MYSQLND_METHOD()
511 zend_hash_init(&self->not_filtered_functions, 0, NULL, NULL, 0); in MYSQLND_METHOD()
518 self->flags |= MYSQLND_DEBUG_FLUSH; in MYSQLND_METHOD()
522 self->flags |= MYSQLND_DEBUG_APPEND; in MYSQLND_METHOD()
538 self->file_name = estrndup(mode + i + 2, j - i - 2); in MYSQLND_METHOD()
542 if (!self->file_name) in MYSQLND_METHOD()
543 self->file_name = (char *) mysqlnd_debug_default_trace_file; in MYSQLND_METHOD()
574 zend_hash_str_add_empty_element(&self->not_filtered_functions, in MYSQLND_METHOD()
610 self->flags |= MYSQLND_DEBUG_DUMP_FILE; in MYSQLND_METHOD()
614 self->flags |= MYSQLND_DEBUG_DUMP_PID; in MYSQLND_METHOD()
618 self->flags |= MYSQLND_DEBUG_DUMP_LINE; in MYSQLND_METHOD()
622 self->flags |= MYSQLND_DEBUG_DUMP_LEVEL; in MYSQLND_METHOD()
636 self->nest_level_limit = atoi(value_str); in MYSQLND_METHOD()
641 self->nest_level_limit = 200; /* default value for FF DBUG */ in MYSQLND_METHOD()
643 self->flags |= MYSQLND_DEBUG_DUMP_TRACE; in MYSQLND_METHOD()
647 self->flags |= MYSQLND_DEBUG_DUMP_TIME; in MYSQLND_METHOD()
657 self->flags |= MYSQLND_DEBUG_TRACE_MEMORY_CALLS; in MYSQLND_METHOD()
661 self->flags |= MYSQLND_DEBUG_PROFILE_CALLS; in MYSQLND_METHOD()