agora inbox for pgsql-hackers@postgresql.org
help / color / mirror / Atom feedpg_namespace -> pg_schema?
528+ messages / 5 participants
[nested] [flat]
* pg_namespace -> pg_schema?
@ 2003-04-25 21:39 Sean Chittenden <sean@chittenden.org>
0 siblings, 1 reply; 528+ messages in thread
From: Sean Chittenden @ 2003-04-25 21:39 UTC (permalink / raw)
To: pgsql-hackers
I know pg_namespace has been in release for one rev, but I was
wondering if for consistency sake there was any interest or desire or
plans to change the system catalog to pg_schema.
CREATE SCHEMA [schema_name];
SET search_path = foo,pubic;
SELECT * FROM pg_namespace;
SELECT * FROM information_schema.schemata;
The four naming schemes seem a bit disjointed. I know schemata is
spec mandated, but the others aren't frozen by anything as far as I
can tell. If 7.3.3 is going to be around for a while, it might be
nice to setup transitional warning and 1:1 views that allow:
CREATE SCHEMA [schema_name];
SET schema_path = foo,public;
SELECT * FROM pg_schema;
to work. Just some thoughts after trying to explain the different
naming practices to someone and being unable to give a good
justification for namespaceo != schema != search_path. Given the
feature hasn't been around that long (only 8mo), figured it might be
worth considering now vs. in 5 years when it becomes apparent that
there not semantically connected even though they all revolve around
the same concept of schemas. -sc
--
Sean Chittenden
^ permalink raw reply [nested|flat] 528+ messages in thread
* Re: pg_namespace -> pg_schema?
@ 2003-04-25 22:20 Tom Lane <tgl@sss.pgh.pa.us>
parent: Sean Chittenden <sean@chittenden.org>
0 siblings, 1 reply; 528+ messages in thread
From: Tom Lane @ 2003-04-25 22:20 UTC (permalink / raw)
To: Sean Chittenden <sean@chittenden.org>; +Cc: pgsql-hackers
Sean Chittenden <sean@chittenden.org> writes:
> I know pg_namespace has been in release for one rev, but I was
> wondering if for consistency sake there was any interest or desire or
> plans to change the system catalog to pg_schema.
No. The choice of catalog name was deliberate: a namespace is not
necessarily identical to a schema. In any case, I can see no value
to renaming it at this late date.
regards, tom lane
^ permalink raw reply [nested|flat] 528+ messages in thread
* Re: [HACKERS] pg_namespace -> pg_schema?
@ 2003-04-29 22:19 Andreas Pflug <Andreas.Pflug@web.de>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 528+ messages in thread
From: Andreas Pflug @ 2003-04-29 22:19 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; Dave Page <dpage@vale-housing.co.uk>; pgadmin-hackers@postgresql.org
Tom Lane wrote:
>Sean Chittenden <sean@chittenden.org> writes:
>
>
>>I know pg_namespace has been in release for one rev, but I was
>>wondering if for consistency sake there was any interest or desire or
>>plans to change the system catalog to pg_schema.
>>
>>
>
>No. The choice of catalog name was deliberate: a namespace is not
>necessarily identical to a schema. In any case, I can see no value
>to renaming it at this late date.
>
> regards, tom lane
>
>
I wonder if we should use the term NAMESPACE instead of SCHEMA in pgAdmin3.
Any suggestions?
Andreas
^ permalink raw reply [nested|flat] 528+ messages in thread
* Re: [HACKERS] pg_namespace -> pg_schema?
@ 2003-04-30 08:11 Dave Page <dpage@vale-housing.co.uk>
parent: Andreas Pflug <Andreas.Pflug@web.de>
0 siblings, 0 replies; 528+ messages in thread
From: Dave Page @ 2003-04-30 08:11 UTC (permalink / raw)
To: Andreas.Pflug@web.de; +Cc: tgl@sss.pgh.pa.us; dpage@vale-housing.co.uk; pgadmin-hackers@postgresql.org
It's rumoured that Andreas Pflug once said:
>>No. The choice of catalog name was deliberate: a namespace is not
>>necessarily identical to a schema. In any case, I can see no value to
>>renaming it at this late date.
>
> I wonder if we should use the term NAMESPACE instead of SCHEMA in
> pgAdmin3. Any suggestions?
In pgAdmin II I deliberately folowed Tom's lead and called them Namespaces
internally and Schemas externally to avoid any confusion on the issue.
Oh, and of course the main class library was already called pgSchema...
Regards, Dave.
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index cc85138e21f..aab80effb00 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) ((t).ticks * ((double) NS_PER_S / GetTimerFrequency())))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--2e47imhqa2hvpvyc
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0002-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
* [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT()
@ 2023-01-20 23:31 Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 528+ messages in thread
From: Andres Freund @ 2023-01-20 23:31 UTC (permalink / raw)
INSTR_TIME_SET_SECONDS() is useful to calculate the end of a time-bound loop
without having to convert into time units (which is
costly). INSTR_TIME_IS_LT() can be used to check the loop condition.
Author:
Reviewed-by:
Discussion: https://postgr.es/m/
Backpatch:
---
src/include/portability/instr_time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/include/portability/instr_time.h b/src/include/portability/instr_time.h
index c0ed491395d..af2ab6ec887 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -15,6 +15,8 @@
*
* INSTR_TIME_IS_ZERO(t) is t equal to zero?
*
+ * INSTR_TIME_IS_LT(x, y) x < y
+ *
* INSTR_TIME_SET_ZERO(t) set t to zero (memset is acceptable too)
*
* INSTR_TIME_SET_CURRENT(t) set t to current time
@@ -22,6 +24,8 @@
* INSTR_TIME_SET_CURRENT_LAZY(t) set t to current time if t is zero,
* evaluates to whether t changed
*
+ * INSTR_TIME_SET_SECONDS(t, s) set t to s seconds
+ *
* INSTR_TIME_ADD(x, y) x += y
*
* INSTR_TIME_SUBTRACT(x, y) x -= y
@@ -122,6 +126,9 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_clock_gettime_ns())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = NS_PER_S * (s))
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
@@ -156,6 +163,9 @@ GetTimerFrequency(void)
#define INSTR_TIME_SET_CURRENT(t) \
((t) = pg_query_performance_counter())
+#define INSTR_TIME_SET_SECONDS(t, s) \
+ ((t).ticks = s * GetTimerFrequency())
+
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (((double) (t).ticks * NS_PER_S) / GetTimerFrequency()))
@@ -168,6 +178,8 @@ GetTimerFrequency(void)
#define INSTR_TIME_IS_ZERO(t) ((t).ticks == 0)
+#define INSTR_TIME_IS_LT(x, y) ((x).ticks < (y).ticks)
+
#define INSTR_TIME_SET_ZERO(t) ((t).ticks = 0)
--
2.38.0
--vt42kbp2j7rjcapp
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v8-0004-wip-report-nanoseconds-in-pg_test_timing.patch"
^ permalink raw reply [nested|flat] 528+ messages in thread
end of thread, other threads:[~2023-01-20 23:31 UTC | newest]
Thread overview: 528+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-04-25 21:39 pg_namespace -> pg_schema? Sean Chittenden <sean@chittenden.org>
2003-04-25 22:20 ` Tom Lane <tgl@sss.pgh.pa.us>
2003-04-29 22:19 ` Andreas Pflug <Andreas.Pflug@web.de>
2003-04-30 08:11 ` Dave Page <dpage@vale-housing.co.uk>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v8 3/5] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
2023-01-20 23:31 [PATCH v9 1/2] instr_time: Add INSTR_TIME_SET_SECONDS(), INSTR_TIME_IS_LT() Andres Freund <andres@anarazel.de>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox