return SUCCESS;
} /* }}} */
+PHPDBG_INFO(memory) /* {{{ */
+{
+ if (is_zend_mm(TSRMLS_C)) {
+ phpdbg_notice("Memory Manager Information");
+ phpdbg_notice("Current");
+ phpdbg_writeln("|-------> Used:\t%.3f kB",
+ (float) (zend_memory_usage(0 TSRMLS_CC)/1024));
+ phpdbg_writeln("|-------> Real:\t%.3f kB",
+ (float) (zend_memory_usage(1 TSRMLS_CC)/1024));
+ phpdbg_notice("Peak");
+ phpdbg_writeln("|-------> Used:\t%.3f kB",
+ (float) (zend_memory_peak_usage(0 TSRMLS_CC)/1024));
+ phpdbg_writeln("|-------> Real:\t%.3f kB",
+ (float) (zend_memory_peak_usage(1 TSRMLS_CC)/1024));
+ } else {
+ phpdbg_error("Memory Manager Disabled !");
+ }
+ return SUCCESS;
+} /* }}} */
+
static inline void phpdbg_print_class_name(zend_class_entry **ce TSRMLS_DC) /* {{{ */
{
phpdbg_write(
PHPDBG_INFO(error);
PHPDBG_INFO(vars);
PHPDBG_INFO(literal);
+PHPDBG_INFO(memory);
static const phpdbg_command_t phpdbg_info_commands[] = {
- PHPDBG_COMMAND_D_EX(break, "show breakpoints", 'b', info_break, NULL, 0),
- PHPDBG_COMMAND_D_EX(files, "lists included files", 'F', info_files, NULL, 0),
- PHPDBG_COMMAND_D_EX(classes, "lists loaded classes", 'c', info_classes, NULL, 0),
- PHPDBG_COMMAND_D_EX(funcs, "lists loaded classes", 'f', info_funcs, NULL, 0),
- PHPDBG_COMMAND_D_EX(error, "show the last error", 'e', info_error, NULL, 0),
+ PHPDBG_COMMAND_D_EX(break, "show breakpoints", 'b', info_break, NULL, 0),
+ PHPDBG_COMMAND_D_EX(files, "show included files", 'F', info_files, NULL, 0),
+ PHPDBG_COMMAND_D_EX(classes, "show loaded classes", 'c', info_classes, NULL, 0),
+ PHPDBG_COMMAND_D_EX(funcs, "show loaded classes", 'f', info_funcs, NULL, 0),
+ PHPDBG_COMMAND_D_EX(error, "show last error", 'e', info_error, NULL, 0),
PHPDBG_COMMAND_D_EX(vars, "show active variables", 'v', info_vars, NULL, 0),
PHPDBG_COMMAND_D_EX(literal, "show active literal constants", 'l', info_literal, NULL, 0),
+ PHPDBG_COMMAND_D_EX(memory, "show memory manager stats", 'm', info_memory, NULL, 0),
PHPDBG_END_COMMAND
};
phpdbg_writeln("Functions\t%d", zend_hash_num_elements(EG(function_table)));
phpdbg_writeln("Constants\t%d", zend_hash_num_elements(EG(zend_constants)));
phpdbg_writeln("Included\t%d", zend_hash_num_elements(&EG(included_files)));
- phpdbg_writeln(
- "Memory\t\t%.3f/%.3f (kB)",
- (float) (zend_memory_usage(1 TSRMLS_CC)/1024),
- (float) (zend_memory_usage(0 TSRMLS_CC)/1024));
-
+
phpdbg_writeln(SEPARATE);
} break;