mirror of
https://github.com/littlefs-project/littlefs.git
synced 2025-12-07 16:12:47 +00:00
scripts: Adopted better input file handling in result scripts
- Error on no/insufficient files. Instead of just returning no results. This is more useful when debugging complicated bash scripts. - Use elf magic to allow any file order in perfbd.py/stack.py. This was already implemented in stack.py, now also adopted in perfbd.py. Elf files always start with the magic string "\x7fELF", so we can use this to figure out the types of input files without needing to rely on argument order. This is just one less thing to worry about when invoking these scripts.
This commit is contained in:
@@ -1015,7 +1015,15 @@ def main(obj_paths, *,
|
||||
**args):
|
||||
# find sizes
|
||||
if not args.get('use', None):
|
||||
# not enough info?
|
||||
if not obj_paths:
|
||||
print("error: no *.o files?",
|
||||
file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
# collect info
|
||||
results = collect(obj_paths, **args)
|
||||
|
||||
else:
|
||||
results = []
|
||||
with openio(args['use']) as f:
|
||||
|
||||
Reference in New Issue
Block a user