2 # SPDX-License-Identifier: GPL-2.0-only
6 # dot2k: transform dot files into a monitor for the Linux kernel.
8 # For further information, see:
9 # Documentation/trace/rv/da_monitor_synthesis.rst
11 if __name__ == '__main__':
12 from dot2.dot2k import dot2k
19 parser = argparse.ArgumentParser(description='transform .dot file into kernel rv monitor')
20 parser.add_argument('-d', "--dot", dest="dot_file", required=True)
21 parser.add_argument('-t', "--monitor_type", dest="monitor_type", required=True)
22 parser.add_argument('-n', "--model_name", dest="model_name", required=False)
23 parser.add_argument("-D", "--description", dest="description", required=False)
24 parser.add_argument("-a", "--auto_patch", dest="auto_patch",
25 action="store_true", required=False,
26 help="Patch the kernel in place")
27 params = parser.parse_args()
29 print("Opening and parsing the dot file %s" % params.dot_file)
31 monitor=dot2k(params.dot_file, params.monitor_type, vars(params))
32 except Exception as e:
33 print('Error: '+ str(e))
37 print("Writing the monitor into the directory %s" % monitor.name)
39 print("Almost done, checklist")
40 print(" - Edit the %s/%s.c to add the instrumentation" % (monitor.name, monitor.name))
41 print(monitor.fill_tracepoint_tooltip())
42 print(monitor.fill_makefile_tooltip())
43 print(monitor.fill_kconfig_tooltip())
44 print(monitor.fill_monitor_tooltip())