diff options
author | Andy Lester <andy@petdance.com> | 2006-07-02 07:17:08 -0500 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-07-03 16:36:14 +0000 |
commit | d86c571c6c8bdb965eda7f35a947bfa0042d63ec (patch) | |
tree | 935452cd2b80a7342234fc5a4d68c82d10574e56 /ext/Devel/DProf | |
parent | f5a63d9722b3dbf74f7754273456749e1e2531d8 (diff) | |
download | perl-d86c571c6c8bdb965eda7f35a947bfa0042d63ec.tar.gz |
DProf.xs patch
Message-ID: <20060702171708.GA20392@petdance.com>
p4raw-id: //depot/perl@28470
Diffstat (limited to 'ext/Devel/DProf')
-rw-r--r-- | ext/Devel/DProf/DProf.xs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/Devel/DProf/DProf.xs b/ext/Devel/DProf/DProf.xs index e5c61ce10e..6ce8e5254a 100644 --- a/ext/Devel/DProf/DProf.xs +++ b/ext/Devel/DProf/DProf.xs @@ -67,6 +67,7 @@ dprof_dbg_sub_notify(pTHX_ SV *Sub) { # include <starlet.h> /* prototype for sys$gettim() */ # include <lib$routines.h> # define Times(ptr) (dprof_times(aTHX_ ptr)) +# define NEEDS_DPROF_TIMES #else # ifndef HZ # ifdef CLK_TCK @@ -77,6 +78,7 @@ dprof_dbg_sub_notify(pTHX_ SV *Sub) { # endif # ifdef OS2 /* times() has significant overhead */ # define Times(ptr) (dprof_times(aTHX_ ptr)) +# define NEEDS_DPROF_TIMES # define INCL_DOSPROFILE # define INCL_DOSERRORS # include <os2.h> @@ -98,7 +100,7 @@ union prof_any { clock_t tms_utime; /* cpu time spent in user space */ clock_t tms_stime; /* cpu time spent in system */ clock_t realtime; /* elapsed real time, in ticks */ - char *name; + const char *name; U32 id; opcode ptype; }; @@ -107,7 +109,7 @@ typedef union prof_any PROFANY; typedef struct { U32 dprof_ticks; - char* out_file_name; /* output file (defaults to tmon.out) */ + const char* out_file_name; /* output file (defaults to tmon.out) */ PerlIO* fp; /* pointer to tmon.out file */ Off_t TIMES_LOCATION; /* Where in the file to store the time totals */ int SAVE_STACK; /* How much data to buffer until end of run */ @@ -175,6 +177,7 @@ prof_state_t g_prof_state; # define g_start_cnt g_prof_state.start_cnt #endif +#ifdef NEEDS_DPROF_TIMES static clock_t dprof_times(pTHX_ struct tms *t) { @@ -225,6 +228,7 @@ dprof_times(pTHX_ struct tms *t) # endif #endif } +#endif static void prof_dumpa(pTHX_ opcode ptype, U32 id) @@ -366,7 +370,7 @@ prof_mark(pTHX_ opcode ptype) CV * const cv = db_get_cv(aTHX_ Sub); GV * const gv = CvGV(cv); - pname = GvSTASH(gv) ? HvNAME_get(GvSTASH(gv)) : 0; + pname = GvSTASH(gv) ? HvNAME_get(GvSTASH(gv)) : NULL; pname = pname ? pname : (char *) "(null)"; gname = GvNAME(gv); |