logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

xdebug xdebug/php_xdebug.h xdebug/xdebug.c xdebug/xdebug_profiler.c - Added: msg#00005

Subject: xdebug xdebug/php_xdebug.h xdebug/xdebug.c xdebug/xdebug_profiler.c - Added xdebug_get_profile_filename() function which returns the current profiler dump file
Date:      Thu Jul 21 17:33:17 CEST 2005
User:      Jani Taskinen
Directory: xdebug

Log Message:
- Added xdebug_get_profile_filename() function which returns the current 
profiler dump file
Modified files:
           xdebug/php_xdebug.h              (version: 1.90)
           xdebug/xdebug.c                  (version: 1.265)
           xdebug/xdebug_profiler.c         (version: 1.28)
[FILE: /xdebug/php_xdebug.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -r1.89 -r1.90
--- xdebug/php_xdebug.h:1.89 Tue Jun 14 05:41:16 2005 GMT
+++ xdebug/php_xdebug.h Thu Jul 21 13:33:17 2005 GMT
@@ -80,6 +80,9 @@
 PHP_FUNCTION(xdebug_stop_trace);
 PHP_FUNCTION(xdebug_get_tracefile_name);
 
+/* profiling functions */
+PHP_FUNCTION(xdebug_get_profile_filename);
+
 /* misc functions */
 PHP_FUNCTION(xdebug_dump_superglobals);
 PHP_FUNCTION(xdebug_set_error_handler);
@@ -164,6 +167,7 @@
        /* profiler globals */
        zend_bool     profiler_enabled;
        FILE         *profile_file;
+       char         *profile_filename;
 
        /* DBGp globals */
        char         *lastcmd;
[FILE: /xdebug/xdebug.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.264
retrieving revision 1.265
diff -u -r1.264 -r1.265
--- xdebug/xdebug.c:1.264 Sat Jul 02 21:10:40 2005 GMT
+++ xdebug/xdebug.c Thu Jul 21 13:33:17 2005 GMT
@@ -139,6 +139,9 @@
        PHP_FE(xdebug_start_trace,           NULL)
        PHP_FE(xdebug_stop_trace,            NULL)
        PHP_FE(xdebug_get_tracefile_name,    NULL)
+
+       PHP_FE(xdebug_get_profile_filename,  NULL)
+
 #if MEMORY_LIMIT
        PHP_FE(xdebug_memory_usage,          NULL)
        PHP_FE(xdebug_peak_memory_usage,     NULL)
@@ -595,6 +598,7 @@
        XG(trace_file)    = NULL;
        XG(tracefile_name) = NULL;
        XG(profile_file)  = NULL;
+       XG(profile_filename) = NULL;
        XG(error_handler) = NULL;
        XG(prev_memory)   = 0;
        XG(function_count) = 0;
@@ -665,6 +669,10 @@
                fclose(XG(profile_file));
        }
 
+       if (XG(profile_filename)) {
+               efree(XG(profile_filename));
+       }
+
        if (XG(error_handler)) {
                efree(XG(error_handler));
        }
@@ -2165,6 +2173,15 @@
        }
 }
 
+PHP_FUNCTION(xdebug_get_profile_filename)
+{
+       if (XG(profile_filename)) {
+               RETURN_STRING(XG(profile_filename), 1);
+       } else {
+               RETURN_FALSE;
+       }
+}
+
 #if MEMORY_LIMIT
 PHP_FUNCTION(xdebug_memory_usage)
 {
[FILE: /xdebug/xdebug_profiler.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- xdebug/xdebug_profiler.c:1.27 Wed Oct 06 05:09:35 2004 GMT
+++ xdebug/xdebug_profiler.c Thu Jul 21 13:33:17 2005 GMT
@@ -58,6 +58,7 @@
        if (!XG(profile_file)) {
                return FAILURE;
        } 
+       XG(profile_filename) = estrdup(filename);
        fprintf(XG(profile_file), "version: 0.9.6\ncmd: %s\npart: 1\n\nevents: 
Time Memory\n\n", script_name);
        return SUCCESS;
 }
<Prev in Thread] Current Thread [Next in Thread>