Skip to content

Commit ce9e57c

Browse files
Added Highlight to visualization graph of executors
1 parent 888d101 commit ce9e57c

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

Python/optimizer.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1938,9 +1938,13 @@ static void
19381938
executor_to_gv(_PyExecutorObject *executor, FILE *out)
19391939
{
19401940
PyCodeObject *code = executor->vm_data.code;
1941+
_PyExecutorObject *cold = _PyExecutor_GetColdExecutor();
1942+
_PyExecutorObject *cold_dynamic = _PyExecutor_GetColdDynamicExecutor();
19411943
fprintf(out, "executor_%p [\n", executor);
19421944
fprintf(out, " shape = none\n");
1943-
1945+
if (executor == cold || executor == cold_dynamic) {
1946+
fprintf(out, " color = gray\n");
1947+
}
19441948
/* Write the HTML table for the uops */
19451949
fprintf(out, " label = <<table border=\"0\" cellspacing=\"0\">\n");
19461950
fprintf(out, " <tr><td port=\"start\" border=\"1\" ><b>Executor</b></td></tr>\n");
@@ -1976,8 +1980,7 @@ executor_to_gv(_PyExecutorObject *executor, FILE *out)
19761980
fprintf(out, "]\n\n");
19771981

19781982
/* Write all the outgoing edges */
1979-
_PyExecutorObject *cold = _PyExecutor_GetColdExecutor();
1980-
_PyExecutorObject *cold_dynamic = _PyExecutor_GetColdDynamicExecutor();
1983+
19811984
for (uint32_t i = 0; i < executor->code_size; i++) {
19821985
_PyUOpInstruction const *inst = &executor->trace[i];
19831986
uint16_t base_opcode = _PyUop_Uncached[inst->opcode];

0 commit comments

Comments
 (0)