find_time_trace.py 405 B

1234567891011121314151617
  1. import os
  2. import sys
  3. # /scripts/find_time_trace.py <object_file> <destination>
  4. # clang generates `-ftime-trace` output file path based on main output file path
  5. def main():
  6. assert len(sys.argv) == 3
  7. obj_path = sys.argv[1]
  8. trace_path = sys.argv[2]
  9. orig_trace_path = obj_path.rpartition('.o')[0] + '.json'
  10. os.rename(orig_trace_path, trace_path)
  11. if __name__ == '__main__':
  12. main()