Author: tim.bunce
Date: Sun Jul  5 05:46:17 2009
New Revision: 802

Modified:
    trunk/NYTProf.xs

Log:
Store fid and lin in subr_entry_st as ints instead of formatted string.


Modified: trunk/NYTProf.xs
==============================================================================
--- trunk/NYTProf.xs    (original)
+++ trunk/NYTProf.xs    Sun Jul  5 05:46:17 2009
@@ -2067,7 +2067,8 @@
  typedef struct subr_entry_st subr_entry_t;
  struct subr_entry_st {
      time_of_day_t initial_call_time;
-    char fid_line[50];
+    int calling_fid;
+    int calling_line;
      SV *subname_sv;
      AV *sub_av;
      CV *sub_cv;
@@ -2114,12 +2115,12 @@
      }

      if (trace_level >= 3)
-        logwarn(" <-     %s %"NVff"s excl = %"NVff"s incl - %"NVff"s  
(%g-%g), oh %g-%g=%gt, d%d @%s #%lu\n",
+        logwarn(" <-     %s %"NVff"s excl = %"NVff"s incl - %"NVff"s  
(%g-%g), oh %g-%g=%gt, d%d @%d:%d #%lu\n",
              SvPV_nolen(subname_sv), excl_subr_sec, incl_subr_sec,  
called_sub_secs,
              cumulative_subr_secs, subr_entry->initial_subr_secs,
              cumulative_overhead_ticks, subr_entry->initial_overhead_ticks,  
overhead_ticks,
              (int)subr_entry->call_depth,
-            subr_entry->fid_line, subr_entry->seqn);
+            subr_entry->calling_fid, subr_entry->calling_line,  
subr_entry->seqn);

      /* only count inclusive time for the outer-most calls */
      if (subr_entry->call_depth <= 1) {
@@ -2137,7 +2138,8 @@
      }
      sv_setnv(excl_time_sv, SvNV(excl_time_sv)+excl_subr_sec);

-    sv_free(subr_entry->subname_sv);
+    if (subr_entry->subname_sv)
+        sv_free(subr_entry->subname_sv);
      subr_entry_latest = subr_entry->caller;

      cumulative_subr_secs += excl_subr_sec;
@@ -2390,6 +2392,8 @@
              ? last_executed_fid
              : get_file_id(aTHX_ file, strlen(file), NYTP_FIDf_VIA_SUB);
          fid_line_key_len = sprintf(fid_line_key, "%u:%d", fid, line);
+        subr_entry->calling_fid  = fid;
+        subr_entry->calling_line = line;

          /* { called_subname => { "fid:line" => [ count, incl_time ] } } */
          sv_tmp = *hv_fetch(sub_callers_hv, subname_pv,
@@ -2464,7 +2468,6 @@

          if (profile_subs) {
              subr_entry->subname_sv = subname_sv;
-            strcpy(subr_entry->fid_line, fid_line_key);
              if (is_xs) {
                  /* acculumate now time we've just spent in the xs sub */
                  incr_sub_inclusive_time(aTHX_ subr_entry);

--~--~---------~--~----~------------~-------~--~----~
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.

Group hosted at:  http://groups.google.com/group/develnytprof-dev
Project hosted at:  http://perl-devel-nytprof.googlecode.com
CPAN distribution:  http://search.cpan.org/dist/Devel-NYTProf

To post, email:  [email protected]
To unsubscribe, email:  [email protected]
-~----------~----~----~----~------~----~------~--~---

Reply via email to