]>
Witch of Git - ivy/blob - tools/trace.py
7 def get_trace(command
):
8 result
= subprocess
.run(
9 ["lldb", "-b", "-o", "run", command
],
10 env
={"IVY_RT_TRACE": "1"},
14 lines
= result
.stdout
.split("\n")
18 if __name__
== '__main__':
19 parser
= argparse
.ArgumentParser(
20 description
="Run an Ivy executable and format its runtime trace.",
24 help="The command to execute.",
27 "-d", "--only-debug", action
="store_true",
28 help="If set, only print the DEBUG outputs",
30 if len(sys
.argv
) <= 1:
33 args
= parser
.parse_args()
35 syms
= format_trace
.get_syms(args
.command
)
36 lines
= get_trace(args
.command
)
37 format_trace
.handle_trace(lines
, syms
, args
.only_debug
)