blob: e18a734e07a1be402565463f2a5adcd4b7f249fd [file] [log] [blame]
#!/usr/bin/env python3
import argparse
parser = argparse.ArgumentParser("", description="Generates an .rc files that fixes the permissions for all the ftrace events listed in the input atrace_categories.txt file")
parser.add_argument("filename", help="Path to the atrace_categories.txt file")
args = parser.parse_args()
print("# Sets permission for vendor ftrace events")
print("on late-init")
with open(args.filename, 'r') as f:
for line in f:
line = line.rstrip('\n')
if line.startswith(' ') or line.startswith('\t'):
path = line.lstrip(" \t")
print(" chmod 0666 /sys/kernel/debug/tracing/events/{}/enable".format(path))
print(" chmod 0666 /sys/kernel/tracing/events/{}/enable".format(path))
print (" # {} trace points".format(line))