]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
cg_annotate: use `<unspecified>` for an unspecified filename.
authorNicholas Nethercote <n.nethercote@gmail.com>
Tue, 28 Mar 2023 22:15:56 +0000 (09:15 +1100)
committerNicholas Nethercote <n.nethercote@gmail.com>
Tue, 28 Mar 2023 22:15:56 +0000 (09:15 +1100)
Users shouldn't ever see this, but it's useful to distinguish this
malformed data file case from the missing symbol case (which is still
shown as `???`).

cachegrind/cg_annotate.in
cachegrind/tests/ann2.cgout
cachegrind/tests/ann2.post.exp

index 2ebd93911b15b9df9111322e6993e320656e7473..d5f1e27bd28697405f4111d4d4e09d8e23e9e375 100755 (executable)
@@ -371,8 +371,8 @@ def read_cgout_file() -> tuple[str, str, Events, DictFlfnCc, DictFlDictLineCc, C
 
             elif line.startswith("fl="):
                 curr_fl = line[3:-1]
-                # A `fn=` line should follow, overwriting the "???".
-                curr_flfn = Flfn((curr_fl, "???"))
+                # A `fn=` line should follow, overwriting the function name.
+                curr_flfn = Flfn((curr_fl, "<unspecified>"))
 
             elif m := re.match(r"summary:\s+(.*)", line):
                 try:
index 08ddddc31757664928ba7df4a7a6734a1fd2ca1a..2bb2bf8eb81e849bf3e2b9ca4895e05f138d8eef 100644 (file)
@@ -82,7 +82,7 @@ fn=f1
 
 # File found in ann2-aux/, via -I.
 fl=ann2-via-I.rs
-fn=f1
+# No `fn=` line, so the function name falls back to `<unspecified>`.
 1 1000 500 0
 
 # File below the threshold. (It also doesn't exist, but that doesn't matter. We
index 0e85dcb556c5ad028248dc4fdb0f2ce914fc678d..6fcbe12f626d08f988a6ba2fa9fc69627b900ed0 100644 (file)
@@ -30,7 +30,7 @@ A              SomeCount         VeryLongEventName        file:function
 15,000 (15.0%)       600  (0.6%)                 0        ann2-basic.rs:f1
  9,000  (9.0%)     6,000  (6.0%)                 0        ann2-could-not-be-found.rs:f1
  2,000  (2.0%)       100  (0.1%)                 0        ann2-basic.rs:f2
- 1,000  (1.0%)       500  (0.5%)                 0        ann2-via-I.rs:f1
+ 1,000  (1.0%)       500  (0.5%)                 0        ann2-via-I.rs:<unspecified>
  1,000  (1.0%)       300  (0.3%)            -1,000 (n/a)  ann2-past-the-end.rs:f1
 -1,000 (-1.0%)         0                         0        ann2-negatives.rs:neg3
 -1,000 (-1.0%)         0                         0        ann2-negatives.rs:neg2