]> sourceware.org Git - valgrind.git/commitdiff
Change `Threshold:` to `Thresholds:`.
authorNicholas Nethercote <n.nethercote@gmail.com>
Tue, 21 Mar 2023 00:58:36 +0000 (11:58 +1100)
committerNicholas Nethercote <n.nethercote@gmail.com>
Thu, 23 Mar 2023 02:00:17 +0000 (13:00 +1100)
Because all the thresholds other than the first one were always 100, due
to historical reasons.

cachegrind/cg_annotate.in
cachegrind/tests/ann1.post.exp
cachegrind/tests/ann2.post.exp
cachegrind/tests/ann3.post.exp
cachegrind/tests/diff.post.exp

index ac2f2b792ab51ed887a960ecb961dde13d8843e1..48bf4f1aab8e7dad198c784b1da2310d7673e9ea 100755 (executable)
@@ -233,12 +233,6 @@ class Events:
     # Like `sort_events`, but indices into `events`, rather than names.
     sort_indices: list[int]
 
-    # Threshold percentages, one per sort event. Dictates when we stop printing
-    # functions. Positions correspond to positions in `sort_events`. Only
-    # `thresholds[0]` is actually used for thresholding, for historical
-    # reasons.
-    threshold_percs: list[float]
-
     def __init__(self, text: str) -> None:
         self.events = text.split()
         self.num_events = len(self.events)
@@ -269,11 +263,6 @@ class Events:
 
         self.sort_indices = [event_indices[event] for event in self.sort_events]
 
-        # The primary sort event gets the --threshold value, and all other sort
-        # events get 100% (i.e. ignored).
-        self.threshold_percs = [100] * len(self.sort_events)
-        self.threshold_percs[0] = args.threshold
-
     def mk_cc(self, text: str) -> Cc:
         # This is slightly faster than a list comprehension.
         counts = list(map(int, text.split()))
@@ -561,7 +550,7 @@ def print_header(desc: str, cmd: str, events: Events) -> None:
     print("Events recorded: ", *events.events)
     print("Events shown:    ", *events.show_events)
     print("Event sort order:", *events.sort_events)
-    print("Thresholds:      ", *events.threshold_percs)
+    print("Threshold:       ", args.threshold)
 
     if len(args.include) == 0:
         print("Include dirs:     ")
@@ -598,9 +587,7 @@ def print_flfn_ccs(
     threshold_index = events.sort_indices[0]
 
     # Convert the threshold from a percentage to an event count.
-    threshold = (
-        events.threshold_percs[0] * abs(summary_cc.counts[threshold_index]) / 100
-    )
+    threshold = args.threshold * abs(summary_cc.counts[threshold_index]) / 100
 
     def meets_threshold(flfn_and_cc: tuple[Flfn, Cc]) -> bool:
         cc = flfn_and_cc[1]
index 10196377a71b5cc0501cd833013634f765280b0a..e946b0a743c90f175e57de745f011e7de016198a 100644 (file)
@@ -7,7 +7,7 @@ Data file:        cgout-test
 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
-Thresholds:       0.1 100 100 100 100 100 100 100 100
+Threshold:        0.1
 Include dirs:     
 User annotated:   
 Auto-annotation:  on
index 44283468130b1fc3e97f3b96bc55ff47334ae0ca..a4884e61522112d3d1b743219d3bcc1ece82d677 100644 (file)
@@ -7,7 +7,7 @@ Data file:        cgout-test
 Events recorded:  Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw
 Events shown:     Dw Dr Ir
 Event sort order: Dr
-Thresholds:       0.1
+Threshold       0.1
 Include dirs:     
 User annotated:   a.c
 Auto-annotation:  off
index 063715aa6f8dcbd011994eb598b391774273dd9d..a5520b5af3b280c7d9e89c627eeaf97e13d1778c 100644 (file)
@@ -4,7 +4,7 @@ Data file:        cgout-test3
 Events recorded:  A SomeCount VeryLongEventName
 Events shown:     A SomeCount VeryLongEventName
 Event sort order: A SomeCount VeryLongEventName
-Thresholds:       0.5 100 100
+Threshold:        0.5
 Include dirs:     ann3-no-such-dir
                   ann3-no-such-dir-2
                   ann3-aux
index 81fbe3e92092dc6c2b331d9f3bf5e969f686f3a8..7d3b8aeeee2889ba1b54cc4f36a57f93fcb64f2b 100644 (file)
@@ -5,7 +5,7 @@ Data file:        cgout-diff
 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
-Thresholds:       0.1 100 100 100 100 100 100 100 100
+Threshold:        0.1
 Include dirs:     
 User annotated:   
 Auto-annotation:  on
This page took 0.033658 seconds and 5 git commands to generate.