()
| 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): |
no test coverage detected