mirror of
https://github.com/littlefs-project/littlefs.git
synced 2025-10-20 13:23:58 +08:00
Tweaked generation of .cgi files, error code for recursion in stack.py
GCC is a bit annoying here, it can't generate .cgi files without generating the related .o files, though I suppose the alternative risks duplicating a large amount of compilation work (littlefs is really a small project). Previously we rebuilt the .o files anytime we needed .cgi files (callgraph info used for stack.py). This changes it so we always built .cgi files as a side-effect of compilation. This is similar to the .d file generation, though may be annoying if the system cc doesn't support --callgraph-info.
This commit is contained in:
@@ -384,6 +384,11 @@ def main(**args):
|
||||
print_entries(by='name')
|
||||
print_totals()
|
||||
|
||||
# catch recursion
|
||||
if args.get('error_on_recursion') and any(
|
||||
m.isinf(limit) for _, _, _, limit, _ in results):
|
||||
sys.exit(2)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import argparse
|
||||
@@ -424,6 +429,8 @@ if __name__ == "__main__":
|
||||
help="Show file-level calls.")
|
||||
parser.add_argument('-Y', '--summary', action='store_true',
|
||||
help="Only show the total stack size.")
|
||||
parser.add_argument('-e', '--error-on-recursion', action='store_true',
|
||||
help="Error if any functions are recursive.")
|
||||
parser.add_argument('--build-dir',
|
||||
help="Specify the relative build directory. Used to map object files \
|
||||
to the correct source files.")
|
||||
|
Reference in New Issue
Block a user