mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
instr_time.h: add INSTR_TIME_SET_CURRENT_LAZY
Sets the timestamp to current if not already set. Will acquire more callers momentarily. Author: Fabien Coelho Discussion: https://postgr.es/m/alpine.DEB.2.21.1808111104320.1705@lancre
This commit is contained in:
@ -62,13 +62,9 @@ InstrInit(Instrumentation *instr, int instrument_options)
|
||||
void
|
||||
InstrStartNode(Instrumentation *instr)
|
||||
{
|
||||
if (instr->need_timer)
|
||||
{
|
||||
if (INSTR_TIME_IS_ZERO(instr->starttime))
|
||||
INSTR_TIME_SET_CURRENT(instr->starttime);
|
||||
else
|
||||
elog(ERROR, "InstrStartNode called twice in a row");
|
||||
}
|
||||
if (instr->need_timer &&
|
||||
INSTR_TIME_SET_CURRENT_LAZY(instr->starttime))
|
||||
elog(ERROR, "InstrStartNode called twice in a row");
|
||||
|
||||
/* save buffer usage totals at node entry, if needed */
|
||||
if (instr->need_bufusage)
|
||||
|
Reference in New Issue
Block a user