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