From d7081e936e60f7233edf046f654d25dc41639a40 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 23 Mar 2023 14:04:53 +1100 Subject: [PATCH] Rename a bunch of `cg_annotate` test files. For more consistency. --- cachegrind/tests/Makefile.am | 13 +- .../{diff.post.exp => ann-diff.post.exp} | 4 +- .../{ann1.stderr.exp => ann-diff.stderr.exp} | 0 cachegrind/tests/ann-diff.vgtest | 6 + cachegrind/tests/{cgout-test => ann1.cgout} | 4 + cachegrind/tests/ann1.vgtest | 6 - .../tests/{ann1.post.exp => ann1a.post.exp} | 2 +- .../{ann3.stderr.exp => ann1a.stderr.exp} | 0 cachegrind/tests/ann1a.vgtest | 6 + cachegrind/tests/{cgout-test2 => ann1b.cgout} | 0 cachegrind/tests/ann1b.post.exp | 51 ++++++ .../{diff.stderr.exp => ann1b.stderr.exp} | 0 cachegrind/tests/ann1b.vgtest | 6 + .../ann3-via-I.rs => ann2-aux/ann2-via-I.rs} | 0 .../tests/{ann3-basic.rs => ann2-basic.rs} | 0 ...gout.rs => ann2-more-recent-than-cgout.rs} | 0 .../{ann3-negatives.rs => ann2-negatives.rs} | 0 ...3-past-the-end.rs => ann2-past-the-end.rs} | 0 ...nn3-unmentioned.rs => ann2-unmentioned.rs} | 0 cachegrind/tests/{cgout-test3 => ann2.cgout} | 20 +- cachegrind/tests/ann2.post.exp | 171 ++++++++++++++---- cachegrind/tests/ann2.vgtest | 13 +- cachegrind/tests/ann3.post.exp | 150 --------------- cachegrind/tests/ann3.vgtest | 13 -- cachegrind/tests/diff.vgtest | 6 - 25 files changed, 237 insertions(+), 234 deletions(-) rename cachegrind/tests/{diff.post.exp => ann-diff.post.exp} (96%) rename cachegrind/tests/{ann1.stderr.exp => ann-diff.stderr.exp} (100%) create mode 100644 cachegrind/tests/ann-diff.vgtest rename cachegrind/tests/{cgout-test => ann1.cgout} (99%) delete mode 100644 cachegrind/tests/ann1.vgtest rename cachegrind/tests/{ann1.post.exp => ann1a.post.exp} (99%) rename cachegrind/tests/{ann3.stderr.exp => ann1a.stderr.exp} (100%) create mode 100644 cachegrind/tests/ann1a.vgtest rename cachegrind/tests/{cgout-test2 => ann1b.cgout} (100%) create mode 100644 cachegrind/tests/ann1b.post.exp rename cachegrind/tests/{diff.stderr.exp => ann1b.stderr.exp} (100%) create mode 100644 cachegrind/tests/ann1b.vgtest rename cachegrind/tests/{ann3-aux/ann3-via-I.rs => ann2-aux/ann2-via-I.rs} (100%) rename cachegrind/tests/{ann3-basic.rs => ann2-basic.rs} (100%) rename cachegrind/tests/{ann3-more-recent-than-cgout.rs => ann2-more-recent-than-cgout.rs} (100%) rename cachegrind/tests/{ann3-negatives.rs => ann2-negatives.rs} (100%) rename cachegrind/tests/{ann3-past-the-end.rs => ann2-past-the-end.rs} (100%) rename cachegrind/tests/{ann3-unmentioned.rs => ann2-unmentioned.rs} (100%) rename cachegrind/tests/{cgout-test3 => ann2.cgout} (86%) delete mode 100644 cachegrind/tests/ann3.post.exp delete mode 100644 cachegrind/tests/ann3.vgtest delete mode 100644 cachegrind/tests/diff.vgtest diff --git a/cachegrind/tests/Makefile.am b/cachegrind/tests/Makefile.am index ded05c8fdb..cee1f29167 100644 --- a/cachegrind/tests/Makefile.am +++ b/cachegrind/tests/Makefile.am @@ -10,16 +10,15 @@ DIST_SUBDIRS = x86 . dist_noinst_SCRIPTS = filter_stderr filter_cachesim_discards -# Note that test.c and a.c are not compiled. -# They just serve as input for cg_annotate in ann1 and ann2. +# Note that `test.c` and `a.c` are not compiled. +# They just serve as input for cg_annotate in `ann1a` and `ann1b`. EXTRA_DIST = \ - cgout-test \ - ann1.post.exp ann1.stderr.exp ann1.vgtest \ - ann2.post.exp ann2.stderr.exp ann2.vgtest \ - ann3.post.exp ann3.stderr.exp ann3.vgtest \ + ann-diff.post.exp ann-diff.stderr.exp ann-diff.vgtest \ + ann1a.post.exp ann1a.stderr.exp ann1a.vgtest ann1.cgout \ + ann1b.post.exp ann1b.stderr.exp ann1b.vgtest ann1b.cgout \ + ann2.post.exp ann2.stderr.exp ann2.vgtest ann2.cgout \ chdir.vgtest chdir.stderr.exp \ clreq.vgtest clreq.stderr.exp \ - diff.post.exp diff.stderr.exp diff.vgtest \ dlclose.vgtest dlclose.stderr.exp dlclose.stdout.exp \ notpower2.vgtest notpower2.stderr.exp \ test.c a.c \ diff --git a/cachegrind/tests/diff.post.exp b/cachegrind/tests/ann-diff.post.exp similarity index 96% rename from cachegrind/tests/diff.post.exp rename to cachegrind/tests/ann-diff.post.exp index ed95860ddf..986edf35ef 100644 --- a/cachegrind/tests/diff.post.exp +++ b/cachegrind/tests/ann-diff.post.exp @@ -1,7 +1,7 @@ -------------------------------------------------------------------------------- -Files compared: cgout-test; cgout-test2 +Files compared: ann1.cgout; ann1b.cgout Command: ./a.out; ./a.out -Data file: cgout-diff +Data file: ann-diff.cgout Events recorded: Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw Events shown: Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw Event sort order: Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw diff --git a/cachegrind/tests/ann1.stderr.exp b/cachegrind/tests/ann-diff.stderr.exp similarity index 100% rename from cachegrind/tests/ann1.stderr.exp rename to cachegrind/tests/ann-diff.stderr.exp diff --git a/cachegrind/tests/ann-diff.vgtest b/cachegrind/tests/ann-diff.vgtest new file mode 100644 index 0000000000..e3dc0992e0 --- /dev/null +++ b/cachegrind/tests/ann-diff.vgtest @@ -0,0 +1,6 @@ +# The `prog` doesn't matter because we don't use its output. Instead we test +# the post-processing of the `ann{1,1b}.cgout` test files. +prog: ../../tests/true +vgopts: --cachegrind-out-file=cachegrind.out +post: perl ../../cachegrind/cg_diff ann1.cgout ann1b.cgout > ann-diff.cgout && perl ../../cachegrind/cg_annotate ann-diff.cgout +cleanup: rm ann-diff.cgout diff --git a/cachegrind/tests/cgout-test b/cachegrind/tests/ann1.cgout similarity index 99% rename from cachegrind/tests/cgout-test rename to cachegrind/tests/ann1.cgout index b625ec8ccd..fbe91822c3 100644 --- a/cachegrind/tests/cgout-test +++ b/cachegrind/tests/ann1.cgout @@ -3,6 +3,10 @@ desc: D1 cache: 32768 B, 64 B, 8-way associative desc: LL cache: 19922944 B, 64 B, 19-way associative cmd: ./a.out events: Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw + +# Note: this file is called ann1.cgout because it is used by the tests `ann1a` +# and `ann1b`. + fl=/build/glibc-OTsEL5/glibc-2.27/csu/../csu/init-first.c fn=_init 52 8 1 1 0 0 0 4 0 0 diff --git a/cachegrind/tests/ann1.vgtest b/cachegrind/tests/ann1.vgtest deleted file mode 100644 index 660f524f09..0000000000 --- a/cachegrind/tests/ann1.vgtest +++ /dev/null @@ -1,6 +0,0 @@ -# The 'prog' doesn't matter because we don't use its output. Instead we test -# the post-processing of the cgout-test file. -prog: ../../tests/true -vgopts: --cachegrind-out-file=cachegrind.out -post: touch cgout-test && python3 ../../cachegrind/cg_annotate --show=Ir,I1mr,ILmr --show-percs=no cgout-test -cleanup: rm cachegrind.out diff --git a/cachegrind/tests/ann1.post.exp b/cachegrind/tests/ann1a.post.exp similarity index 99% rename from cachegrind/tests/ann1.post.exp rename to cachegrind/tests/ann1a.post.exp index e4c1d7c8d9..05e9c5afa6 100644 --- a/cachegrind/tests/ann1.post.exp +++ b/cachegrind/tests/ann1a.post.exp @@ -3,7 +3,7 @@ I1 cache: 32768 B, 64 B, 8-way associative D1 cache: 32768 B, 64 B, 8-way associative LL cache: 19922944 B, 64 B, 19-way associative Command: ./a.out -Data file: cgout-test +Data file: ann1.cgout Events recorded: Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw Events shown: Ir I1mr ILmr Event sort order: Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw diff --git a/cachegrind/tests/ann3.stderr.exp b/cachegrind/tests/ann1a.stderr.exp similarity index 100% rename from cachegrind/tests/ann3.stderr.exp rename to cachegrind/tests/ann1a.stderr.exp diff --git a/cachegrind/tests/ann1a.vgtest b/cachegrind/tests/ann1a.vgtest new file mode 100644 index 0000000000..1774f1b1c4 --- /dev/null +++ b/cachegrind/tests/ann1a.vgtest @@ -0,0 +1,6 @@ +# The `prog` doesn't matter because we don't use its output. Instead we test +# the post-processing of the `ann1.cgout` file. +prog: ../../tests/true +vgopts: --cachegrind-out-file=cachegrind.out +post: touch ann1.cgout && python3 ../../cachegrind/cg_annotate --show=Ir,I1mr,ILmr --show-percs=no ann1.cgout +cleanup: rm cachegrind.out diff --git a/cachegrind/tests/cgout-test2 b/cachegrind/tests/ann1b.cgout similarity index 100% rename from cachegrind/tests/cgout-test2 rename to cachegrind/tests/ann1b.cgout diff --git a/cachegrind/tests/ann1b.post.exp b/cachegrind/tests/ann1b.post.exp new file mode 100644 index 0000000000..302416a44d --- /dev/null +++ b/cachegrind/tests/ann1b.post.exp @@ -0,0 +1,51 @@ +-------------------------------------------------------------------------------- +I1 cache: 32768 B, 64 B, 8-way associative +D1 cache: 32768 B, 64 B, 8-way associative +LL cache: 19922944 B, 64 B, 19-way associative +Command: ./a.out +Data file: ann1.cgout +Events recorded: Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw +Events shown: Dw Dr Ir +Event sort order: Dr +Threshold: 0.1 +Include dirs: +User annotated: a.c +Auto-annotation: off + +-------------------------------------------------------------------------------- +Dw Dr Ir +-------------------------------------------------------------------------------- +18,005 (100.0%) 4,057,955 (100.0%) 5,229,753 (100.0%) PROGRAM TOTALS + +-------------------------------------------------------------------------------- +Dw Dr Ir file:function +-------------------------------------------------------------------------------- + 3 (0.0%) 4,000,004 (98.6%) 5,000,015 (95.6%) a.c:main +4,543 (25.2%) 17,566 (0.4%) 47,993 (0.9%) /build/glibc-OTsEL5/glibc-2.27/elf/dl-lookup.c:do_lookup_x +3,083 (17.1%) 5,750 (0.1%) 28,534 (0.5%) /build/glibc-OTsEL5/glibc-2.27/elf/dl-lookup.c:_dl_lookup_symbol_x + 8 (0.0%) 5,521 (0.1%) 28,136 (0.5%) /build/glibc-OTsEL5/glibc-2.27/elf/dl-tunables.c:__GI___tunables_init +2,490 (13.8%) 5,219 (0.1%) 21,821 (0.4%) /build/glibc-OTsEL5/glibc-2.27/elf/../sysdeps/x86_64/dl-machine.h:_dl_relocate_object + 0 5,158 (0.1%) 25,408 (0.5%) /build/glibc-OTsEL5/glibc-2.27/string/../sysdeps/x86_64/strcmp.S:strcmp + +-------------------------------------------------------------------------------- +-- User-annotated source: a.c +-------------------------------------------------------------------------------- +Dw Dr Ir + + 1 (0.0%) 0 2 (0.0%) int main(void) { + 1 (0.0%) 0 1 (0.0%) int z = 0; + 1 (0.0%) 2,000,001 (49.3%) 3,000,004 (57.4%) for (int i = 0; i < 1000000; i++) { + 0 2,000,000 (49.3%) 2,000,000 (38.2%) z += i; + . . . } + 0 1 (0.0%) 6 (0.0%) return z % 256; + 0 2 (0.0%) 2 (0.0%) } + +-------------------------------------------------------------------------------- +Dw Dr Ir +-------------------------------------------------------------------------------- + 3 (0.0%) 4,000,004 (98.6%) 5,000,015 (95.6%) annotated: files known & above threshold & readable, line numbers known + 0 0 0 annotated: files known & above threshold & readable, line numbers unknown + 0 0 0 unannotated: files known & above threshold & unreadable +18,002 (100.0%) 57,951 (1.4%) 229,738 (4.4%) unannotated: files known & below threshold + 0 0 0 unannotated: files unknown + diff --git a/cachegrind/tests/diff.stderr.exp b/cachegrind/tests/ann1b.stderr.exp similarity index 100% rename from cachegrind/tests/diff.stderr.exp rename to cachegrind/tests/ann1b.stderr.exp diff --git a/cachegrind/tests/ann1b.vgtest b/cachegrind/tests/ann1b.vgtest new file mode 100644 index 0000000000..5eacaa8b10 --- /dev/null +++ b/cachegrind/tests/ann1b.vgtest @@ -0,0 +1,6 @@ +# The `prog` doesn't matter because we don't use its output. Instead we test +# the post-processing of the `ann1.cgout` file. +prog: ../../tests/true +vgopts: --cachegrind-out-file=cachegrind.out +post: touch ann1.cgout && python3 ../../cachegrind/cg_annotate --sort=Dr --show=Dw,Dr,Ir --auto=no ann1.cgout a.c +cleanup: rm cachegrind.out diff --git a/cachegrind/tests/ann3-aux/ann3-via-I.rs b/cachegrind/tests/ann2-aux/ann2-via-I.rs similarity index 100% rename from cachegrind/tests/ann3-aux/ann3-via-I.rs rename to cachegrind/tests/ann2-aux/ann2-via-I.rs diff --git a/cachegrind/tests/ann3-basic.rs b/cachegrind/tests/ann2-basic.rs similarity index 100% rename from cachegrind/tests/ann3-basic.rs rename to cachegrind/tests/ann2-basic.rs diff --git a/cachegrind/tests/ann3-more-recent-than-cgout.rs b/cachegrind/tests/ann2-more-recent-than-cgout.rs similarity index 100% rename from cachegrind/tests/ann3-more-recent-than-cgout.rs rename to cachegrind/tests/ann2-more-recent-than-cgout.rs diff --git a/cachegrind/tests/ann3-negatives.rs b/cachegrind/tests/ann2-negatives.rs similarity index 100% rename from cachegrind/tests/ann3-negatives.rs rename to cachegrind/tests/ann2-negatives.rs diff --git a/cachegrind/tests/ann3-past-the-end.rs b/cachegrind/tests/ann2-past-the-end.rs similarity index 100% rename from cachegrind/tests/ann3-past-the-end.rs rename to cachegrind/tests/ann2-past-the-end.rs diff --git a/cachegrind/tests/ann3-unmentioned.rs b/cachegrind/tests/ann2-unmentioned.rs similarity index 100% rename from cachegrind/tests/ann3-unmentioned.rs rename to cachegrind/tests/ann2-unmentioned.rs diff --git a/cachegrind/tests/cgout-test3 b/cachegrind/tests/ann2.cgout similarity index 86% rename from cachegrind/tests/cgout-test3 rename to cachegrind/tests/ann2.cgout index 600ae9b317..08ddddc317 100644 --- a/cachegrind/tests/cgout-test3 +++ b/cachegrind/tests/ann2.cgout @@ -1,8 +1,8 @@ -cmd: ann3 +cmd: ann2 events: A SomeCount VeryLongEventName # A file testing various things. -fl=ann3-basic.rs +fl=ann2-basic.rs # This one has the counts to get the totals to 100,000/100,000/0. fn=f0 7 70091 90291 0 @@ -41,12 +41,12 @@ fn=f6 20 50 0 0 # File with source newer than the cgout file. -fl=ann3-more-recent-than-cgout.rs +fl=ann2-more-recent-than-cgout.rs fn=new 2 1000 0 0 # File with negative and positive values. -fl=ann3-negatives.rs +fl=ann2-negatives.rs # Various, and the sum is zero. fn=neg1 0 -1000 -1000 -1000 @@ -65,8 +65,8 @@ fn=neg3 11 10000 0 -20 # File with source newer than the cgout file. -fl=ann3-past-the-end.rs -# This filename is repeated in ann3-could-not-be-found.rs above. +fl=ann2-past-the-end.rs +# This filename is repeated in ann2-could-not-be-found.rs above. fn=f1 1 200 100 0 20 300 100 0 @@ -74,20 +74,20 @@ fn=f1 22 200 0 -1000 # File mentioned here, but not present on disk. -fl=ann3-could-not-be-found.rs +fl=ann2-could-not-be-found.rs fn=f1 100 3000 2000 0 101 3000 2000 0 102 3000 2000 0 -# File found in ann3-aux/, via -I. -fl=ann3-via-I.rs +# File found in ann2-aux/, via -I. +fl=ann2-via-I.rs fn=f1 1 1000 500 0 # File below the threshold. (It also doesn't exist, but that doesn't matter. We # don't try to open it because it's below the threshold.) -fl=ann3-below-threshold.rs +fl=ann2-below-threshold.rs fn=below1 1 100 50 0 2 100 50 0 diff --git a/cachegrind/tests/ann2.post.exp b/cachegrind/tests/ann2.post.exp index 98f083e912..204a472d3e 100644 --- a/cachegrind/tests/ann2.post.exp +++ b/cachegrind/tests/ann2.post.exp @@ -1,51 +1,150 @@ -------------------------------------------------------------------------------- -I1 cache: 32768 B, 64 B, 8-way associative -D1 cache: 32768 B, 64 B, 8-way associative -LL cache: 19922944 B, 64 B, 19-way associative -Command: ./a.out -Data file: cgout-test -Events recorded: Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw -Events shown: Dw Dr Ir -Event sort order: Dr -Threshold: 0.1 -Include dirs: -User annotated: a.c -Auto-annotation: off +Command: ann2 +Data file: ann2.cgout +Events recorded: A SomeCount VeryLongEventName +Events shown: A SomeCount VeryLongEventName +Event sort order: A SomeCount VeryLongEventName +Threshold: 0.5 +Include dirs: ann2-no-such-dir + ann2-no-such-dir-2 + ann2-aux +User annotated: ann2-unmentioned.rs + ann2-no-such-file.rs +Auto-annotation: on -------------------------------------------------------------------------------- -Dw Dr Ir +A SomeCount VeryLongEventName -------------------------------------------------------------------------------- -18,005 (100.0%) 4,057,955 (100.0%) 5,229,753 (100.0%) PROGRAM TOTALS +100,000 (100.0%) 100,000 (100.0%) 0 PROGRAM TOTALS -------------------------------------------------------------------------------- -Dw Dr Ir file:function +A SomeCount VeryLongEventName file:function -------------------------------------------------------------------------------- - 3 (0.0%) 4,000,004 (98.6%) 5,000,015 (95.6%) a.c:main -4,543 (25.2%) 17,566 (0.4%) 47,993 (0.9%) /build/glibc-OTsEL5/glibc-2.27/elf/dl-lookup.c:do_lookup_x -3,083 (17.1%) 5,750 (0.1%) 28,534 (0.5%) /build/glibc-OTsEL5/glibc-2.27/elf/dl-lookup.c:_dl_lookup_symbol_x - 8 (0.0%) 5,521 (0.1%) 28,136 (0.5%) /build/glibc-OTsEL5/glibc-2.27/elf/dl-tunables.c:__GI___tunables_init -2,490 (13.8%) 5,219 (0.1%) 21,821 (0.4%) /build/glibc-OTsEL5/glibc-2.27/elf/../sysdeps/x86_64/dl-machine.h:_dl_relocate_object - 0 5,158 (0.1%) 25,408 (0.5%) /build/glibc-OTsEL5/glibc-2.27/string/../sysdeps/x86_64/strcmp.S:strcmp +70,091 (70.1%) 90,291 (90.3%) 0 ann2-basic.rs:f0 +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%) 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 + 1,000 (1.0%) 0 0 ann2-more-recent-than-cgout.rs:new + 1,000 (1.0%) 0 0 ???:unknown + 500 (0.5%) 0 0 ann2-basic.rs:f6 + 500 (0.5%) 0 0 ann2-basic.rs:f4 -------------------------------------------------------------------------------- --- User-annotated source: a.c +-- Auto-annotated source: ann2-basic.rs -------------------------------------------------------------------------------- -Dw Dr Ir +A SomeCount VeryLongEventName - 1 (0.0%) 0 2 (0.0%) int main(void) { - 1 (0.0%) 0 1 (0.0%) int z = 0; - 1 (0.0%) 2,000,001 (49.3%) 3,000,004 (57.4%) for (int i = 0; i < 1000000; i++) { - 0 2,000,000 (49.3%) 2,000,000 (38.2%) z += i; - . . . } - 0 1 (0.0%) 6 (0.0%) return z % 256; - 0 2 (0.0%) 2 (0.0%) } + 7,100 (7.1%) 100 (0.1%) 0 + +-- line 2 ---------------------------------------- + . . . two + . . . three + 5,000 (5.0%) 500 (0.5%) 0 four + 5,000 (5.0%) 100 (0.1%) 0 five + . . . six +70,091 (70.1%) 90,291 (90.3%) 0 seven + . . . eight + 110 (0.1%) 9 (0.0%) 0 nine + . . . ten + . . . eleven + 200 (0.2%) 0 0 twelve + 200 (0.2%) 0 0 thirteen + 100 (0.1%) 0 0 fourteen + 0 0 0 fifteen + 0 0 0 sixteen + 0 0 0 seventeen + 0 0 0 eighteen + 499 (0.5%) 2,000 (2.0%) 0 nineteen + 300 (0.3%) 0 0 twenty + +-------------------------------------------------------------------------------- +-- Auto-annotated source: ann2-more-recent-than-cgout.rs +-------------------------------------------------------------------------------- +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@ Source file 'ann2-more-recent-than-cgout.rs' is more recent than input file 'ann2.cgout'. +@ Annotations may not be correct. +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + +A SomeCount VeryLongEventName + + . . . one +1,000 (1.0%) 0 0 two + . . . three + . . . four +-- line 4 ---------------------------------------- + +-------------------------------------------------------------------------------- +-- Auto-annotated source: ann2-negatives.rs +-------------------------------------------------------------------------------- +A SomeCount VeryLongEventName + + -2,000 (-2.0%) -1,000 (-1.0%) -990 (n/a) + + 2,000 (2.0%) 2,000 (2.0%) 2,000 (n/a) one + -1,000 (-1.0%) -1,000 (-1.0%) 0 two + . . . three + . . . four + 999,000 (999.0%) 0 -150,000 (n/a) five +-1,000,000 (-1000.0%) 0 150,000 (n/a) six + . . . seven + . . . eight + . . . nine + -10,000 (-10.0%) 0 10 (n/a) ten + 10,000 (10.0%) 0 -20 (n/a) eleven + . . . twelve + . . . thirteen +-- line 13 ---------------------------------------- + +-------------------------------------------------------------------------------- +-- Auto-annotated source: ann2-past-the-end.rs +-------------------------------------------------------------------------------- +A SomeCount VeryLongEventName + +200 (0.2%) 100 (0.1%) 0 one + . . . two + . . . three +-- line 3 ---------------------------------------- +-- line 18 ---------------------------------------- +300 (0.3%) 100 (0.1%) 0 +300 (0.3%) 100 (0.1%) 0 +200 (0.2%) 0 -1,000 (n/a) + +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@ Information recorded about lines past the end of 'ann2-past-the-end.rs'. +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + +-------------------------------------------------------------------------------- +-- User-annotated source: ann2-unmentioned.rs +-------------------------------------------------------------------------------- + No information has been collected for ann2-unmentioned.rs + +-------------------------------------------------------------------------------- +-- Auto-annotated source: ann2-aux/ann2-via-I.rs +-------------------------------------------------------------------------------- +A SomeCount VeryLongEventName + +1,000 (1.0%) 500 (0.5%) 0 one + +-------------------------------------------------------------------------------- +The following files chosen for auto-annotation could not be read: +-------------------------------------------------------------------------------- + ann2-could-not-be-found.rs + ann2-no-such-file.rs -------------------------------------------------------------------------------- -Dw Dr Ir +A SomeCount VeryLongEventName -------------------------------------------------------------------------------- - 3 (0.0%) 4,000,004 (98.6%) 5,000,015 (95.6%) annotated: files known & above threshold & readable, line numbers known - 0 0 0 annotated: files known & above threshold & readable, line numbers unknown - 0 0 0 unannotated: files known & above threshold & unreadable -18,002 (100.0%) 57,951 (1.4%) 229,738 (4.4%) unannotated: files known & below threshold - 0 0 0 unannotated: files unknown +84,500 (84.5%) 94,700 (94.7%) 990 (n/a) annotated: files known & above threshold & readable, line numbers known + 5,100 (5.1%) -900 (-0.9%) -990 (n/a) annotated: files known & above threshold & readable, line numbers unknown + 9,000 (9.0%) 6,000 (6.0%) 0 unannotated: files known & above threshold & unreadable + 400 (0.4%) 200 (0.2%) 0 unannotated: files known & below threshold + 1,000 (1.0%) 0 0 unannotated: files unknown diff --git a/cachegrind/tests/ann2.vgtest b/cachegrind/tests/ann2.vgtest index 9ef76e38e9..b2ec364c72 100644 --- a/cachegrind/tests/ann2.vgtest +++ b/cachegrind/tests/ann2.vgtest @@ -1,6 +1,13 @@ -# The 'prog' doesn't matter because we don't use its output. Instead we test -# the post-processing of the cgout-test file. +# This tests all sorts of edge cases. See the comments in `ann2.cgout` for +# more details. +# +# The `prog` doesn't matter because we don't use its output. Instead we test +# the post-processing of the `ann2.cgout` file. prog: ../../tests/true vgopts: --cachegrind-out-file=cachegrind.out -post: touch cgout-test && python3 ../../cachegrind/cg_annotate --sort=Dr --show=Dw,Dr,Ir --auto=no cgout-test a.c + +# The `sleep` is to ensure the mtime of the second touched file is greater than +# the mtime of the first touched file. +post: touch ann2.cgout && sleep 0.1 && touch ann2-more-recent-than-cgout.rs && python3 ../../cachegrind/cg_annotate --context 2 --auto --show-percs=yes --threshold=0.5 -Iann2-no-such-dir --include ann2-no-such-dir-2 -I=ann2-aux ann2.cgout ann2-unmentioned.rs ann2-no-such-file.rs + cleanup: rm cachegrind.out diff --git a/cachegrind/tests/ann3.post.exp b/cachegrind/tests/ann3.post.exp deleted file mode 100644 index 2b86957bc1..0000000000 --- a/cachegrind/tests/ann3.post.exp +++ /dev/null @@ -1,150 +0,0 @@ --------------------------------------------------------------------------------- -Command: ann3 -Data file: cgout-test3 -Events recorded: A SomeCount VeryLongEventName -Events shown: A SomeCount VeryLongEventName -Event sort order: A SomeCount VeryLongEventName -Threshold: 0.5 -Include dirs: ann3-no-such-dir - ann3-no-such-dir-2 - ann3-aux -User annotated: ann3-unmentioned.rs - ann3-no-such-file.rs -Auto-annotation: on - --------------------------------------------------------------------------------- -A SomeCount VeryLongEventName --------------------------------------------------------------------------------- -100,000 (100.0%) 100,000 (100.0%) 0 PROGRAM TOTALS - --------------------------------------------------------------------------------- -A SomeCount VeryLongEventName file:function --------------------------------------------------------------------------------- -70,091 (70.1%) 90,291 (90.3%) 0 ann3-basic.rs:f0 -15,000 (15.0%) 600 (0.6%) 0 ann3-basic.rs:f1 - 9,000 (9.0%) 6,000 (6.0%) 0 ann3-could-not-be-found.rs:f1 - 2,000 (2.0%) 100 (0.1%) 0 ann3-basic.rs:f2 - 1,000 (1.0%) 500 (0.5%) 0 ann3-via-I.rs:f1 - 1,000 (1.0%) 300 (0.3%) -1,000 (n/a) ann3-past-the-end.rs:f1 --1,000 (-1.0%) 0 0 ann3-negatives.rs:neg3 --1,000 (-1.0%) 0 0 ann3-negatives.rs:neg2 - 1,000 (1.0%) 0 0 ann3-more-recent-than-cgout.rs:new - 1,000 (1.0%) 0 0 ???:unknown - 500 (0.5%) 0 0 ann3-basic.rs:f6 - 500 (0.5%) 0 0 ann3-basic.rs:f4 - --------------------------------------------------------------------------------- --- Auto-annotated source: ann3-basic.rs --------------------------------------------------------------------------------- -A SomeCount VeryLongEventName - - 7,100 (7.1%) 100 (0.1%) 0 - --- line 2 ---------------------------------------- - . . . two - . . . three - 5,000 (5.0%) 500 (0.5%) 0 four - 5,000 (5.0%) 100 (0.1%) 0 five - . . . six -70,091 (70.1%) 90,291 (90.3%) 0 seven - . . . eight - 110 (0.1%) 9 (0.0%) 0 nine - . . . ten - . . . eleven - 200 (0.2%) 0 0 twelve - 200 (0.2%) 0 0 thirteen - 100 (0.1%) 0 0 fourteen - 0 0 0 fifteen - 0 0 0 sixteen - 0 0 0 seventeen - 0 0 0 eighteen - 499 (0.5%) 2,000 (2.0%) 0 nineteen - 300 (0.3%) 0 0 twenty - --------------------------------------------------------------------------------- --- Auto-annotated source: ann3-more-recent-than-cgout.rs --------------------------------------------------------------------------------- -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@ Source file 'ann3-more-recent-than-cgout.rs' is more recent than input file 'cgout-test3'. -@ Annotations may not be correct. -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -A SomeCount VeryLongEventName - - . . . one -1,000 (1.0%) 0 0 two - . . . three - . . . four --- line 4 ---------------------------------------- - --------------------------------------------------------------------------------- --- Auto-annotated source: ann3-negatives.rs --------------------------------------------------------------------------------- -A SomeCount VeryLongEventName - - -2,000 (-2.0%) -1,000 (-1.0%) -990 (n/a) - - 2,000 (2.0%) 2,000 (2.0%) 2,000 (n/a) one - -1,000 (-1.0%) -1,000 (-1.0%) 0 two - . . . three - . . . four - 999,000 (999.0%) 0 -150,000 (n/a) five --1,000,000 (-1000.0%) 0 150,000 (n/a) six - . . . seven - . . . eight - . . . nine - -10,000 (-10.0%) 0 10 (n/a) ten - 10,000 (10.0%) 0 -20 (n/a) eleven - . . . twelve - . . . thirteen --- line 13 ---------------------------------------- - --------------------------------------------------------------------------------- --- Auto-annotated source: ann3-past-the-end.rs --------------------------------------------------------------------------------- -A SomeCount VeryLongEventName - -200 (0.2%) 100 (0.1%) 0 one - . . . two - . . . three --- line 3 ---------------------------------------- --- line 18 ---------------------------------------- -300 (0.3%) 100 (0.1%) 0 -300 (0.3%) 100 (0.1%) 0 -200 (0.2%) 0 -1,000 (n/a) - -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ WARNING @@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@ Information recorded about lines past the end of 'ann3-past-the-end.rs'. -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - --------------------------------------------------------------------------------- --- User-annotated source: ann3-unmentioned.rs --------------------------------------------------------------------------------- - No information has been collected for ann3-unmentioned.rs - --------------------------------------------------------------------------------- --- Auto-annotated source: ann3-aux/ann3-via-I.rs --------------------------------------------------------------------------------- -A SomeCount VeryLongEventName - -1,000 (1.0%) 500 (0.5%) 0 one - --------------------------------------------------------------------------------- -The following files chosen for auto-annotation could not be read: --------------------------------------------------------------------------------- - ann3-could-not-be-found.rs - ann3-no-such-file.rs - --------------------------------------------------------------------------------- -A SomeCount VeryLongEventName --------------------------------------------------------------------------------- -84,500 (84.5%) 94,700 (94.7%) 990 (n/a) annotated: files known & above threshold & readable, line numbers known - 5,100 (5.1%) -900 (-0.9%) -990 (n/a) annotated: files known & above threshold & readable, line numbers unknown - 9,000 (9.0%) 6,000 (6.0%) 0 unannotated: files known & above threshold & unreadable - 400 (0.4%) 200 (0.2%) 0 unannotated: files known & below threshold - 1,000 (1.0%) 0 0 unannotated: files unknown - diff --git a/cachegrind/tests/ann3.vgtest b/cachegrind/tests/ann3.vgtest deleted file mode 100644 index c4fb4cb140..0000000000 --- a/cachegrind/tests/ann3.vgtest +++ /dev/null @@ -1,13 +0,0 @@ -# This tests all sorts of edge cases. See the comments in `cgout-test3` for -# more details. -# -# The `prog` doesn't matter because we don't use its output. Instead we test -# the post-processing of the cgout-test file. -prog: ../../tests/true -vgopts: --cachegrind-out-file=cachegrind.out - -# The `sleep` is to ensure the mtime of the second touched file is greater than -# the mtime of the first touched file. -post: touch cgout-test3 && sleep 0.1 && touch ann3-more-recent-than-cgout.rs && python3 ../../cachegrind/cg_annotate --context 2 --auto --show-percs=yes --threshold=0.5 -Iann3-no-such-dir --include ann3-no-such-dir-2 -I=ann3-aux cgout-test3 ann3-unmentioned.rs ann3-no-such-file.rs - -cleanup: rm cachegrind.out diff --git a/cachegrind/tests/diff.vgtest b/cachegrind/tests/diff.vgtest deleted file mode 100644 index f38361ec0e..0000000000 --- a/cachegrind/tests/diff.vgtest +++ /dev/null @@ -1,6 +0,0 @@ -# The 'prog' doesn't matter because we don't use its output. Instead we test -# the post-processing of the cgout-test file. -prog: ../../tests/true -vgopts: --cachegrind-out-file=cachegrind.out -post: perl ../../cachegrind/cg_diff cgout-test cgout-test2 > cgout-diff && perl ../../cachegrind/cg_annotate cgout-diff -cleanup: rm cgout-diff -- 2.43.5