Revision: 993
Author: [email protected]
Date: Wed Dec 23 09:38:26 2009
Log: Actually add an entry to the fid mapping table when a given file is  
seen again.
Map the fid before checking the %seen_subs lookup table.
confess() if no fid mapping is found, when one is expected.
http://code.google.com/p/perl-devel-nytprof/source/detail?r=993

Modified:
  /trunk/bin/nytprofmerge

=======================================
--- /trunk/bin/nytprofmerge     Fri Dec 18 13:58:11 2009
+++ /trunk/bin/nytprofmerge     Wed Dec 23 09:38:26 2009
@@ -124,7 +124,10 @@
         } else {
             $new_eval_fid = $eval_fid;
             $new_fid = $file_to_fid{$name};
-            return if defined $new_fid;
+            if(defined $new_fid) {
+                $fids{$fid} = $new_fid;
+                return;
+            }

             $new_fid = $next_fid++;
             $fids{$fid} = $new_fid;
@@ -142,15 +145,18 @@
       },
       SUB_INFO => sub {
         my (undef, $fid, $first_line, $last_line, $name) = @_;
+        confess("No mapping for $fid") unless defined $fids{$fid};
+        $fid = $fids{$fid};
         if(!$seen_subs{"$fid,$name"}++) {
             $out->write('s');
-            $out->output_int($fids{$fid});
+            $out->output_int($fid);
             $out->output_str($name);
             $out->output_int($first_line, $last_line, 0);
         }
       },
       SUB_CALLERS => sub {
         my (undef, $fid, $line, $count, $incl_time, $excl_time, $ucpu_time,  
$scpu_time, $reci_time, $rec_depth, $called, $caller) = @_;
+        confess("No mapping for $fid") unless defined $fids{$fid};
         $fid = $fids{$fid};

         if ($callers{"$fid,$line"}{$called}{$caller}) {

-- 
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