From 6f790c77713d38ef98d8f22ebf25cb2e11d3012a Mon Sep 17 00:00:00 2001 From: cc_db_dev Date: Fri, 27 May 2022 06:46:00 -0400 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96CPUUsageGetCurrent=E5=9C=A8ex?= =?UTF-8?q?plain=E4=B8=AD=E7=9A=84=E8=B0=83=E7=94=A8=E6=97=B6=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gausskernel/runtime/executor/instrument.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gausskernel/runtime/executor/instrument.cpp b/src/gausskernel/runtime/executor/instrument.cpp index 59331452a..1850883f1 100644 --- a/src/gausskernel/runtime/executor/instrument.cpp +++ b/src/gausskernel/runtime/executor/instrument.cpp @@ -481,6 +481,8 @@ void InstrStartNode(Instrumentation* instr) instr->first_time = true; } + CPUUsageGetCurrent(&instr->cpuusage_start); + if (instr->need_timer) { if (INSTR_TIME_IS_ZERO(instr->starttime)) { INSTR_TIME_SET_CURRENT(instr->starttime); @@ -492,8 +494,6 @@ void InstrStartNode(Instrumentation* instr) /* save buffer usage totals at node entry, if needed */ if (instr->need_bufusage) instr->bufusage_start = *u_sess->instr_cxt.pg_buffer_usage; - - CPUUsageGetCurrent(&instr->cpuusage_start); } /* @@ -530,8 +530,6 @@ void InstrStopNode(Instrumentation* instr, double n_tuples, bool containMemory) instr_time end_time; CPUUsage cpu_usage; - CPUUsageGetCurrent(&cpu_usage); - /* count the returned tuples */ instr->ntuples += n_tuples; @@ -547,6 +545,8 @@ void InstrStopNode(Instrumentation* instr, double n_tuples, bool containMemory) INSTR_TIME_SET_ZERO(instr->starttime); } + + CPUUsageGetCurrent(&cpu_usage); /* Add delta of buffer usage since entry to node's totals */ if (instr->need_bufusage) {