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.
This commit is contained in:
Christopher Haster
2025-03-12 18:40:52 -05:00
parent f3889d8932
commit 3a290c41ab
8 changed files with 39 additions and 23 deletions

View File

@@ -1029,10 +1029,13 @@ def main(obj_paths, *,
**args): **args):
# figure out what fields we're interested in # figure out what fields we're interested in
if by is None: 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: if fields is None:
fields = ['size'] fields = CodeResult._fields
# find sizes # find sizes
if not args.get('use', None): if not args.get('use', None):

View File

@@ -970,8 +970,10 @@ def main(gcda_paths, *,
if by is None: if by is None:
if (args.get('annotate') if (args.get('annotate')
or args.get('lines') or args.get('lines')
or args.get('branches')): or args.get('branches')
by = ['file', 'line'] or args.get('output')
or args.get('output_json')):
by = CovResult._by
else: else:
by = ['function'] by = ['function']
@@ -981,7 +983,7 @@ def main(gcda_paths, *,
or args.get('branches') or args.get('branches')
or args.get('output') or args.get('output')
or args.get('output_json')): or args.get('output_json')):
fields = ['calls', 'hits', 'funcs', 'lines', 'branches'] fields = CovResult._fields
elif not hits: elif not hits:
fields = ['lines', 'branches'] fields = ['lines', 'branches']
else: else:

View File

@@ -1292,16 +1292,17 @@ def main(obj_paths, *,
# figure out what fields we're interested in # figure out what fields we're interested in
labels = None labels = None
if by is 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'] by = ['z', 'i', 'function']
labels = ['function'] labels = ['function']
else: else:
by = ['function'] by = ['function']
if fields is None: if fields is None:
if (args.get('output') if args.get('output') or args.get('output_json'):
or args.get('output_json')): fields = CtxResult._fields
fields = ['off', 'size']
else: else:
fields = ['size'] fields = ['size']

View File

@@ -1029,10 +1029,13 @@ def main(obj_paths, *,
**args): **args):
# figure out what fields we're interested in # figure out what fields we're interested in
if by is None: 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: if fields is None:
fields = ['size'] fields = DataResult._fields
# find sizes # find sizes
if not args.get('use', None): if not args.get('use', None):

View File

@@ -1503,8 +1503,10 @@ def report(perf_paths, *,
labels = None labels = None
if by is None: if by is None:
if (args.get('annotate') if (args.get('annotate')
or args.get('threshold')): or args.get('threshold')
by = ['file', 'line'] or args.get('output')
or args.get('output_json')):
by = PerfResult._by
elif depth is not None or hot is not None: elif depth is not None or hot is not None:
by = ['z', 'function'] by = ['z', 'function']
labels = ['function'] labels = ['function']
@@ -1516,7 +1518,7 @@ def report(perf_paths, *,
or args.get('threshold') or args.get('threshold')
or args.get('output') or args.get('output')
or args.get('output_json')): or args.get('output_json')):
fields = ['cycles', 'bmisses', 'branches', 'cmisses', 'caches'] fields = PerfResult._fields
elif not branches and not caches: elif not branches and not caches:
fields = ['cycles'] fields = ['cycles']
elif branches: elif branches:

View File

@@ -1492,8 +1492,10 @@ def report(paths, *,
or args.get('threshold') or args.get('threshold')
or args.get('read_threshold') or args.get('read_threshold')
or args.get('prog_threshold') or args.get('prog_threshold')
or args.get('erase_threshold')): or args.get('erase_threshold')
by = ['file', 'line'] or args.get('output')
or args.get('output_json')):
by = PerfBdResult._by
elif depth is not None or hot is not None: elif depth is not None or hot is not None:
by = ['z', 'function'] by = ['z', 'function']
labels = ['function'] labels = ['function']
@@ -1501,7 +1503,7 @@ def report(paths, *,
by = ['function'] by = ['function']
if fields is None: if fields is None:
fields = ['readed', 'proged', 'erased'] fields = PerfBdResult._fields
# figure out depth # figure out depth
if depth is None: if depth is None:

View File

@@ -1035,14 +1035,16 @@ def main(ci_paths,
# figure out what fields we're interested in # figure out what fields we're interested in
labels = None labels = None
if by is 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'] by = ['z', 'function']
labels = ['function'] labels = ['function']
else: else:
by = ['function'] by = ['function']
if fields is None: if fields is None:
fields = ['frame', 'limit'] fields = StackResult._fields
# figure out depth # figure out depth
if depth is None: if depth is None:

View File

@@ -1173,16 +1173,17 @@ def main(obj_paths, *,
# figure out what fields we're interested in # figure out what fields we're interested in
labels = None labels = None
if by is 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'] by = ['z', 'i', 'struct']
labels = ['struct'] labels = ['struct']
else: else:
by = ['struct'] by = ['struct']
if fields is None: if fields is None:
if (args.get('output') if args.get('output') or args.get('output_json'):
or args.get('output_json')): fields = StructResult._fields
fields = ['off', 'size', 'align']
else: else:
fields = ['size', 'align'] fields = ['size', 'align']