]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Merge r6043 (callgrind: fix warning about malformed creator line)
authorJulian Seward <jseward@acm.org>
Tue, 12 Sep 2006 21:07:53 +0000 (21:07 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 12 Sep 2006 21:07:53 +0000 (21:07 +0000)
(JosefW)

git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_3_2_BRANCH@6055

callgrind/callgrind_annotate.in

index 6d36f0602bdd8708e0e173185df4420f0336b8bf..617354d194582860e0192dd924d19a55423c4d8e 100644 (file)
@@ -100,6 +100,7 @@ my $desc = "";
 my $cmd = "";
 
 # Info on the profiled process.
+my $creator = "";
 my $pid = "";
 my $part = "";
 my $thread = "";
@@ -310,10 +311,12 @@ sub process_cmd_line()
     }
 
     if ($input_file eq "") {
-      $input_file = (<cachegrind.out*>)[0];
+      $input_file = (<callgrind.out*>)[0];
       if (!defined $input_file) {
-       $input_file = "cachegrind.out";
+         $input_file = (<cachegrind.out*>)[0];
       }
+
+      (defined $input_file) or die($usage);
       print "Reading data from '$input_file'...\n";
     }
 }
@@ -403,6 +406,7 @@ sub read_input_file()
        else { $desc .= "$dline\n"; }
       }
       elsif (/^cmd:\s+(.*)$/)  { $cmd = $1; }
+      elsif (/^creator:\s+(.*)$/)  { $creator = $1; }
       elsif (/^positions:\s+(.*)$/) {
        my $positions = $1;
        $has_line = ($positions =~ /line/);
@@ -669,6 +673,11 @@ sub read_input_file()
 #-----------------------------------------------------------------------------
 sub print_options ()
 {
+    print($fancy);
+    print "Profile data file '$input_file'";
+    if ($creator ne "") { print " (creator: $creator)"; }
+    print "\n";
+
     print($fancy);
     print($desc);
     my $target = $cmd;