]>
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 def trace(command
, only_debug
):
19 syms
= format_trace
.get_syms(command
)
20 lines
= get_trace(command
)
21 format_trace
.handle_trace(lines
, syms
, only_debug
)
25 parser
= argparse
.ArgumentParser(
26 description
="Run an Ivy executable and format its runtime trace.",
30 help="The command to execute.",
33 "-d", "--only-debug", action
="store_true",
34 help="If set, only print the DEBUG outputs",
36 if len(sys
.argv
) <= 1:
39 args
= parser
.parse_args()
40 trace(args
.command
, args
.only_debug
)
43 if __name__
== '__main__':