agora inbox for [email protected]help / color / mirror / Atom feed
KPGsql 267+ messages / 4 participants [nested] [flat]
* KPGsql @ 1999-01-18 17:17 Bruce Momjian <[email protected]> 0 siblings, 1 reply; 267+ messages in thread From: Bruce Momjian @ 1999-01-18 17:17 UTC (permalink / raw) To: PostgreSQL-development <[email protected]> New interface. IMHO, not as nice as pgaccess. http://home.primus.baynet.de/mgeisler/kpgsql/ -- Bruce Momjian | http://www.op.net/~candle [email protected] | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026 ^ permalink raw reply [nested|flat] 267+ messages in thread
* Re: [HACKERS] KPGsql @ 1999-01-18 19:04 The Hermit Hacker <[email protected]> parent: Bruce Momjian <[email protected]> 0 siblings, 1 reply; 267+ messages in thread From: The Hermit Hacker @ 1999-01-18 19:04 UTC (permalink / raw) To: Bruce Momjian <[email protected]>; +Cc: PostgreSQL-development <[email protected]> Old interface...been around since almost the day that the first CD went out, and hasn't been worked on since, either...or, at least, nothing new has come out :( On Mon, 18 Jan 1999, Bruce Momjian wrote: > New interface. IMHO, not as nice as pgaccess. > > http://home.primus.baynet.de/mgeisler/kpgsql/ > > -- > Bruce Momjian | http://www.op.net/~candle > [email protected] | (610) 853-3000 > + If your life is a hard drive, | 830 Blythe Avenue > + Christ can be your backup. | Drexel Hill, Pennsylvania 19026 > Marc G. Fournier Systems Administrator @ hub.org primary: [email protected] secondary: scrappy@{freebsd|postgresql}.org ^ permalink raw reply [nested|flat] 267+ messages in thread
* Re: [HACKERS] KPGsql @ 1999-01-19 08:33 Michael Meskes <[email protected]> parent: The Hermit Hacker <[email protected]> 0 siblings, 1 reply; 267+ messages in thread From: Michael Meskes @ 1999-01-19 08:33 UTC (permalink / raw) To: PostgreSQL-development <[email protected]> On Mon, Jan 18, 1999 at 03:04:46PM -0400, The Hermit Hacker wrote: > Old interface...been around since almost the day that the first CD went > out, and hasn't been worked on since, either...or, at least, nothing new > has come out :( Is there a web site where we list URLs for tools like this? Michael -- Michael Meskes | Go SF 49ers! Th.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire! Tel.: (+49) 2431/72651 | Use Debian GNU/Linux! Email: [email protected] | Use PostgreSQL! ^ permalink raw reply [nested|flat] 267+ messages in thread
* Re: [HACKERS] KPGsql @ 1999-01-19 20:46 Bruce Momjian <[email protected]> parent: Michael Meskes <[email protected]> 0 siblings, 1 reply; 267+ messages in thread From: Bruce Momjian @ 1999-01-19 20:46 UTC (permalink / raw) To: Michael Meskes <[email protected]>; +Cc: [email protected] > On Mon, Jan 18, 1999 at 03:04:46PM -0400, The Hermit Hacker wrote: > > Old interface...been around since almost the day that the first CD went > > out, and hasn't been worked on since, either...or, at least, nothing new > > has come out :( > > Is there a web site where we list URLs for tools like this? It is: http://home.primus.baynet.de/mgeisler/kpgsql/ Check out www.xshare.com. That's where I got this info. Xshare has PostgreSQL, and tons of other open source software links. -- Bruce Momjian | http://www.op.net/~candle [email protected] | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026 ^ permalink raw reply [nested|flat] 267+ messages in thread
* Re: [HACKERS] KPGsql @ 1999-01-20 09:02 Michael Meskes <[email protected]> parent: Bruce Momjian <[email protected]> 0 siblings, 1 reply; 267+ messages in thread From: Michael Meskes @ 1999-01-20 09:02 UTC (permalink / raw) To: [email protected] On Tue, Jan 19, 1999 at 03:46:11PM -0500, Bruce Momjian wrote: > > Is there a web site where we list URLs for tools like this? > .. > Check out www.xshare.com. That's where I got this info. Xshare has > PostgreSQL, and tons of other open source software links. I will, but I meant a playe on www.postgresql.org where we list all tools we know about that are useful in working with postgresql. Michael -- Michael Meskes | Go SF 49ers! Th.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire! Tel.: (+49) 2431/72651 | Use Debian GNU/Linux! Email: [email protected] | Use PostgreSQL! ^ permalink raw reply [nested|flat] 267+ messages in thread
* Re: [HACKERS] KPGsql @ 1999-01-20 19:16 The Hermit Hacker <[email protected]> parent: Michael Meskes <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: The Hermit Hacker @ 1999-01-20 19:16 UTC (permalink / raw) To: Michael Meskes <[email protected]>; +Cc: [email protected] On Wed, 20 Jan 1999, Michael Meskes wrote: > On Tue, Jan 19, 1999 at 03:46:11PM -0500, Bruce Momjian wrote: > > > Is there a web site where we list URLs for tools like this? > > .. > > Check out www.xshare.com. That's where I got this info. Xshare has > > PostgreSQL, and tons of other open source software links. > > I will, but I meant a playe on www.postgresql.org where we list all tools we > know about that are useful in working with postgresql. Right now, just the CD page has links from it...the 'third-party' page needs to be majorly overhauled...the page should work, bu tthe categories are in-complete...will try and re-hit it this coming weekend... Marc G. Fournier Systems Administrator @ hub.org primary: [email protected] secondary: scrappy@{freebsd|postgresql}.org ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 267+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 267+ messages in thread
end of thread, other threads:[~2023-01-16 19:06 UTC | newest] Thread overview: 267+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 1999-01-18 17:17 KPGsql Bruce Momjian <[email protected]> 1999-01-18 19:04 ` The Hermit Hacker <[email protected]> 1999-01-19 08:33 ` Michael Meskes <[email protected]> 1999-01-19 20:46 ` Bruce Momjian <[email protected]> 1999-01-20 09:02 ` Michael Meskes <[email protected]> 1999-01-20 19:16 ` The Hermit Hacker <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox