From 3a290c41abf557e6a097506f4e87e61f418d428c Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Wed, 12 Mar 2025 18:40:52 -0500 Subject: [PATCH] scripts: Reverted -o/-O to include all by-fields by default For the same reason we output all field fields by default: Because machines can process more information than humans can. Worst case, by fields can still be limited via explicit -b/--by flags. --- scripts/code.py | 7 +++++-- scripts/cov.py | 8 +++++--- scripts/ctx.py | 9 +++++---- scripts/data.py | 7 +++++-- scripts/perf.py | 8 +++++--- scripts/perfbd.py | 8 +++++--- scripts/stack.py | 6 ++++-- scripts/structs.py | 9 +++++---- 8 files changed, 39 insertions(+), 23 deletions(-) diff --git a/scripts/code.py b/scripts/code.py index 233db5eb..fe429add 100755 --- a/scripts/code.py +++ b/scripts/code.py @@ -1029,10 +1029,13 @@ def main(obj_paths, *, **args): # figure out what fields we're interested in if by is None: - by = ['function'] + if args.get('output') or args.get('output_json'): + by = CodeResult._by + else: + by = ['function'] if fields is None: - fields = ['size'] + fields = CodeResult._fields # find sizes if not args.get('use', None): diff --git a/scripts/cov.py b/scripts/cov.py index 4e3be2f6..94f2888e 100755 --- a/scripts/cov.py +++ b/scripts/cov.py @@ -970,8 +970,10 @@ def main(gcda_paths, *, if by is None: if (args.get('annotate') or args.get('lines') - or args.get('branches')): - by = ['file', 'line'] + or args.get('branches') + or args.get('output') + or args.get('output_json')): + by = CovResult._by else: by = ['function'] @@ -981,7 +983,7 @@ def main(gcda_paths, *, or args.get('branches') or args.get('output') or args.get('output_json')): - fields = ['calls', 'hits', 'funcs', 'lines', 'branches'] + fields = CovResult._fields elif not hits: fields = ['lines', 'branches'] else: diff --git a/scripts/ctx.py b/scripts/ctx.py index caabab23..176f6353 100755 --- a/scripts/ctx.py +++ b/scripts/ctx.py @@ -1292,16 +1292,17 @@ def main(obj_paths, *, # figure out what fields we're interested in labels = None if by is None: - if depth is not None or hot is not None: + if args.get('output') or args.get('output_json'): + by = CtxResult._by + elif depth is not None or hot is not None: by = ['z', 'i', 'function'] labels = ['function'] else: by = ['function'] if fields is None: - if (args.get('output') - or args.get('output_json')): - fields = ['off', 'size'] + if args.get('output') or args.get('output_json'): + fields = CtxResult._fields else: fields = ['size'] diff --git a/scripts/data.py b/scripts/data.py index 4b64d5e1..0c0bf7bb 100755 --- a/scripts/data.py +++ b/scripts/data.py @@ -1029,10 +1029,13 @@ def main(obj_paths, *, **args): # figure out what fields we're interested in if by is None: - by = ['function'] + if args.get('output') or args.get('output_json'): + by = DataResult._by + else: + by = ['function'] if fields is None: - fields = ['size'] + fields = DataResult._fields # find sizes if not args.get('use', None): diff --git a/scripts/perf.py b/scripts/perf.py index 3e155071..683f7c5f 100755 --- a/scripts/perf.py +++ b/scripts/perf.py @@ -1503,8 +1503,10 @@ def report(perf_paths, *, labels = None if by is None: if (args.get('annotate') - or args.get('threshold')): - by = ['file', 'line'] + or args.get('threshold') + or args.get('output') + or args.get('output_json')): + by = PerfResult._by elif depth is not None or hot is not None: by = ['z', 'function'] labels = ['function'] @@ -1516,7 +1518,7 @@ def report(perf_paths, *, or args.get('threshold') or args.get('output') or args.get('output_json')): - fields = ['cycles', 'bmisses', 'branches', 'cmisses', 'caches'] + fields = PerfResult._fields elif not branches and not caches: fields = ['cycles'] elif branches: diff --git a/scripts/perfbd.py b/scripts/perfbd.py index e8f363c5..d9590f39 100755 --- a/scripts/perfbd.py +++ b/scripts/perfbd.py @@ -1492,8 +1492,10 @@ def report(paths, *, or args.get('threshold') or args.get('read_threshold') or args.get('prog_threshold') - or args.get('erase_threshold')): - by = ['file', 'line'] + or args.get('erase_threshold') + or args.get('output') + or args.get('output_json')): + by = PerfBdResult._by elif depth is not None or hot is not None: by = ['z', 'function'] labels = ['function'] @@ -1501,7 +1503,7 @@ def report(paths, *, by = ['function'] if fields is None: - fields = ['readed', 'proged', 'erased'] + fields = PerfBdResult._fields # figure out depth if depth is None: diff --git a/scripts/stack.py b/scripts/stack.py index f732bc7a..ef21030a 100755 --- a/scripts/stack.py +++ b/scripts/stack.py @@ -1035,14 +1035,16 @@ def main(ci_paths, # figure out what fields we're interested in labels = None if by is None: - if depth is not None or hot is not None: + if args.get('output') or args.get('output_json'): + by = StackResult._by + elif depth is not None or hot is not None: by = ['z', 'function'] labels = ['function'] else: by = ['function'] if fields is None: - fields = ['frame', 'limit'] + fields = StackResult._fields # figure out depth if depth is None: diff --git a/scripts/structs.py b/scripts/structs.py index 40090de8..53285308 100755 --- a/scripts/structs.py +++ b/scripts/structs.py @@ -1173,16 +1173,17 @@ def main(obj_paths, *, # figure out what fields we're interested in labels = None if by is None: - if depth is not None or hot is not None: + if args.get('output') or args.get('output_json'): + by = StructResult._by + elif depth is not None or hot is not None: by = ['z', 'i', 'struct'] labels = ['struct'] else: by = ['struct'] if fields is None: - if (args.get('output') - or args.get('output_json')): - fields = ['off', 'size', 'align'] + if args.get('output') or args.get('output_json'): + fields = StructResult._fields else: fields = ['size', 'align']