From 2d97182f0dec988fd43cba3b6ac79641284b23af Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 29 Mar 2023 09:15:56 +1100 Subject: [PATCH] cg_annotate: use `` for an unspecified filename. 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 | 4 ++-- cachegrind/tests/ann2.cgout | 2 +- cachegrind/tests/ann2.post.exp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cachegrind/cg_annotate.in b/cachegrind/cg_annotate.in index 2ebd93911b..d5f1e27bd2 100755 --- a/cachegrind/cg_annotate.in +++ b/cachegrind/cg_annotate.in @@ -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, "")) elif m := re.match(r"summary:\s+(.*)", line): try: diff --git a/cachegrind/tests/ann2.cgout b/cachegrind/tests/ann2.cgout index 08ddddc317..2bb2bf8eb8 100644 --- a/cachegrind/tests/ann2.cgout +++ b/cachegrind/tests/ann2.cgout @@ -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 ``. 1 1000 500 0 # File below the threshold. (It also doesn't exist, but that doesn't matter. We diff --git a/cachegrind/tests/ann2.post.exp b/cachegrind/tests/ann2.post.exp index 0e85dcb556..6fcbe12f62 100644 --- a/cachegrind/tests/ann2.post.exp +++ b/cachegrind/tests/ann2.post.exp @@ -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: 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 -- 2.47.2