MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / log_access

Method log_access

tools/toolchain_profiler.py:138–148  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

136
137 @staticmethod
138 def log_access():
139 # Note: This function is called in two importantly different contexts: in
140 # "main" process and in python subprocesses invoked via
141 # subprocessing.Pool.map(). The subprocesses have their own PIDs, and
142 # hence record their own data JSON files, but since the process pool is
143 # maintained internally by python, the toolchain profiler does not track
144 # the parent->child process spawns for the subprocessing pools. Therefore
145 # any profiling events that the subprocess children generate are virtually
146 # treated as if they were performed by the parent PID.
147 filename = 'toolchain_profiler.pid_' + str(os.getpid()) + '.json'
148 return open(os.path.join(ToolchainProfiler.profiler_logs_path, filename), 'a', encoding='utf-8')
149
150 @staticmethod
151 def escape_string(arg):

Callers 7

record_process_startMethod · 0.80
record_process_exitMethod · 0.80
enter_blockMethod · 0.80
exit_blockMethod · 0.80

Calls 2

openFunction · 0.50
joinMethod · 0.45

Tested by

no test coverage detected