MCPcopy Create free account
hub / github.com/pytorch/pytorch / export

Function export

tools/code_coverage/package/tool/gcc_coverage.py:32–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30
31
32def export() -> None:
33 start_time = time.time()
34 # collect .gcda files
35 gcda_files = get_gcda_files()
36 # file name like utils.cpp may have same name in different folder
37 gzip_dict: Dict[str, int] = {}
38 for gcda_item in gcda_files:
39 # generate json.gz
40 subprocess.check_call(["gcov", "-i", gcda_item])
41 # cp json.gz to profile/json folder
42 gz_file_name = os.path.basename(gcda_item) + ".gcov.json.gz"
43 new_file_path = os.path.join(
44 JSON_FOLDER_BASE_DIR, update_gzip_dict(gzip_dict, gz_file_name)
45 )
46 os.rename(gz_file_name, new_file_path)
47 # unzip json.gz to json
48 subprocess.check_output(["gzip", "-d", new_file_path])
49 print_time("export take time: ", start_time, summary_time=True)

Callers

nothing calls this directly

Calls 6

get_gcda_filesFunction · 0.85
update_gzip_dictFunction · 0.85
print_timeFunction · 0.85
joinMethod · 0.45
renameMethod · 0.45
check_outputMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…