MCPcopy Create free account
hub / github.com/apache/cloudberry / ExplainPrintJIT

Function ExplainPrintJIT

src/backend/commands/explain.c:1197–1281  ·  view source on GitHub ↗

* ExplainPrintJIT - * Append information about JITing to es->str. */

Source from the content-addressed store, hash-verified

1195 * Append information about JITing to es->str.
1196 */
1197static void
1198ExplainPrintJIT(ExplainState *es, int jit_flags, JitInstrumentation *ji)
1199{
1200 instr_time total_time;
1201
1202 /* don't print information if no JITing happened */
1203 if (!ji || ji->created_functions == 0)
1204 return;
1205
1206 /* calculate total time */
1207 INSTR_TIME_SET_ZERO(total_time);
1208 INSTR_TIME_ADD(total_time, ji->generation_counter);
1209 INSTR_TIME_ADD(total_time, ji->inlining_counter);
1210 INSTR_TIME_ADD(total_time, ji->optimization_counter);
1211 INSTR_TIME_ADD(total_time, ji->emission_counter);
1212
1213 ExplainOpenGroup("JIT", "JIT", true, es);
1214
1215 /* for higher density, open code the text output format */
1216 if (es->format == EXPLAIN_FORMAT_TEXT)
1217 {
1218 ExplainIndentText(es);
1219 appendStringInfoString(es->str, "JIT:\n");
1220 es->indent++;
1221
1222 ExplainPropertyInteger("Functions", NULL, ji->created_functions, es);
1223
1224 ExplainIndentText(es);
1225 appendStringInfo(es->str, "Options: %s %s, %s %s, %s %s, %s %s\n",
1226 "Inlining", jit_flags & PGJIT_INLINE ? "true" : "false",
1227 "Optimization", jit_flags & PGJIT_OPT3 ? "true" : "false",
1228 "Expressions", jit_flags & PGJIT_EXPR ? "true" : "false",
1229 "Deforming", jit_flags & PGJIT_DEFORM ? "true" : "false");
1230
1231 if (es->analyze && es->timing)
1232 {
1233 ExplainIndentText(es);
1234 appendStringInfo(es->str,
1235 "Timing: %s %.3f ms, %s %.3f ms, %s %.3f ms, %s %.3f ms, %s %.3f ms\n",
1236 "Generation", 1000.0 * INSTR_TIME_GET_DOUBLE(ji->generation_counter),
1237 "Inlining", 1000.0 * INSTR_TIME_GET_DOUBLE(ji->inlining_counter),
1238 "Optimization", 1000.0 * INSTR_TIME_GET_DOUBLE(ji->optimization_counter),
1239 "Emission", 1000.0 * INSTR_TIME_GET_DOUBLE(ji->emission_counter),
1240 "Total", 1000.0 * INSTR_TIME_GET_DOUBLE(total_time));
1241 }
1242
1243 es->indent--;
1244 }
1245 else
1246 {
1247 ExplainPropertyInteger("Functions", NULL, ji->created_functions, es);
1248
1249 ExplainOpenGroup("Options", "Options", true, es);
1250 ExplainPropertyBool("Inlining", jit_flags & PGJIT_INLINE, es);
1251 ExplainPropertyBool("Optimization", jit_flags & PGJIT_OPT3, es);
1252 ExplainPropertyBool("Expressions", jit_flags & PGJIT_EXPR, es);
1253 ExplainPropertyBool("Deforming", jit_flags & PGJIT_DEFORM, es);
1254 ExplainCloseGroup("Options", "Options", true, es);

Callers 2

ExplainPrintJITSummaryFunction · 0.85
ExplainNodeFunction · 0.85

Calls 8

ExplainOpenGroupFunction · 0.85
ExplainIndentTextFunction · 0.85
appendStringInfoStringFunction · 0.85
ExplainPropertyIntegerFunction · 0.85
appendStringInfoFunction · 0.85
ExplainPropertyBoolFunction · 0.85
ExplainCloseGroupFunction · 0.85
ExplainPropertyFloatFunction · 0.85

Tested by

no test coverage detected