agora inbox for [email protected]help / color / mirror / Atom feed
[PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() 262+ messages / 2 participants [nested] [flat]
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() @ 2023-01-16 19:06 Andres Freund <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Andres Freund @ 2023-01-16 19:06 UTC (permalink / raw) Useful to calculate the end of a time-bound loop without having to convert into time units (which is costly). Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- src/include/portability/instr_time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h index 185be8d5cad..91492c62a39 100644 --- a/src/include/portability/instr_time.h +++ b/src/include/portability/instr_time.h @@ -22,6 +22,8 @@ * INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero, * evaluates to whether t changed * + * INSTR_TIME_SET_SECOND(t, s) set t to s seconds + * * INSTR_TIME_ADD(x, y) x += y * * INSTR_TIME_SUBTRACT(x, y) x -= y @@ -114,6 +116,9 @@ pg_clock_gettime_ns(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_clock_gettime_ns()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = NS_PER_S * (s)) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (t)) @@ -146,6 +151,9 @@ GetTimerFrequency(void) #define INSTR_TIME_SET_CURRENT(t) \ ((t) = pg_query_performance_counter()) +#define INSTR_TIME_SET_SECONDS(t, s) \ + ((t) = s * GetTimerFrequency()) + #define INSTR_TIME_GET_NANOSEC(t) \ ((uint64) (((t) * NS_PER_S) / GetTimerFrequency())) -- 2.38.0 --ftp5i6iirmkwy7na Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v7-0004-wip-report-nanoseconds-in-pg_test_timing.patch" ^ permalink raw reply [nested|flat] 262+ messages in thread
* [PATCH v27 9/9] Allow to print raw parse tree. @ 2024-12-30 23:53 Tatsuo Ishii <[email protected]> 0 siblings, 0 replies; 262+ messages in thread From: Tatsuo Ishii @ 2024-12-30 23:53 UTC (permalink / raw) --- src/backend/tcop/postgres.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 8590278818..115a8d3ec3 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -646,6 +646,10 @@ pg_parse_query(const char *query_string) #endif /* DEBUG_NODE_TESTS_ENABLED */ + if (Debug_print_parse) + elog_node_display(LOG, "raw parse tree", raw_parsetree_list, + Debug_pretty_print); + TRACE_POSTGRESQL_QUERY_PARSE_DONE(query_string); return raw_parsetree_list; -- 2.25.1 ----Next_Part(Tue_Dec_31_08_57_07_2024_963)---- ^ permalink raw reply [nested|flat] 262+ messages in thread
end of thread, other threads:[~2024-12-30 23:53 UTC | newest] Thread overview: 262+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2023-01-16 19:06 [PATCH v7 3/4] instr_time: Add INSTR_TIME_SET_SECOND() Andres Freund <[email protected]> 2024-12-30 23:53 [PATCH v27 9/9] Allow to print raw parse tree. Tatsuo Ishii <[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