pgsql: Enable probes to work with Mac OS X Leopard and other OSes that

Started by Peter Eisentrautabout 18 years ago28 messageshackers
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

Log Message:
-----------
Enable probes to work with Mac OS X Leopard and other OSes that will
support DTrace in the future.

Switch from using DTRACE_PROBEn macros to the dynamically generated macros.
Use "dtrace -h" to create a header file that contains the dynamically
generated macros to be used in the source code instead of the DTRACE_PROBEn
macros. A dummy header file is generated for builds without DTrace support.

Author: Robert Lor <Robert.Lor@sun.com>

Modified Files:
--------------
pgsql/src/backend:
Makefile (r1.127 -> r1.128)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/Makefile?r1=1.127&amp;r2=1.128)
pgsql/src/backend/access/transam:
xact.c (r1.259 -> r1.260)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/xact.c?r1=1.259&amp;r2=1.260)
pgsql/src/backend/storage/lmgr:
lock.c (r1.182 -> r1.183)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/lmgr/lock.c?r1=1.182&amp;r2=1.183)
lwlock.c (r1.50 -> r1.51)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/lmgr/lwlock.c?r1=1.50&amp;r2=1.51)
pgsql/src/backend/utils:
Makefile (r1.26 -> r1.27)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/Makefile?r1=1.26&amp;r2=1.27)
pgsql/src/include:
Makefile (r1.23 -> r1.24)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/Makefile?r1=1.23&amp;r2=1.24)
c.h (r1.223 -> r1.224)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/c.h?r1=1.223&amp;r2=1.224)
pg_trace.h (r1.3 -> r1.4)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/pg_trace.h?r1=1.3&amp;r2=1.4)

Added Files:
-----------
pgsql/src/backend/utils:
Gen_dummy_probes.sed (r1.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/Gen_dummy_probes.sed?rev=1.1&amp;content-type=text/x-cvsweb-markup)

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#1)
Re: pgsql: Enable probes to work with Mac OS X Leopard and other OSes that

petere@postgresql.org (Peter Eisentraut) writes:

Switch from using DTRACE_PROBEn macros to the dynamically generated macros.
Use "dtrace -h" to create a header file that contains the dynamically
generated macros to be used in the source code instead of the DTRACE_PROBEn
macros. A dummy header file is generated for builds without DTrace support.

Gen_dummy_probes.sed? How likely is that to work on Windows?

regards, tom lane

#3Peter Eisentraut
peter_e@gmx.net
In reply to: Tom Lane (#2)
Re: pgsql: Enable probes to work with Mac OS X Leopard and other OSes that

Tom Lane wrote:

petere@postgresql.org (Peter Eisentraut) writes:

Switch from using DTRACE_PROBEn macros to the dynamically generated
macros. Use "dtrace -h" to create a header file that contains the
dynamically generated macros to be used in the source code instead of the
DTRACE_PROBEn macros. A dummy header file is generated for builds
without DTrace support.

Gen_dummy_probes.sed? How likely is that to work on Windows?

I think if they can run Gen_fmgrtab, they can get this to work.

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#3)
Re: pgsql: Enable probes to work with Mac OS X Leopard and other OSes that

Peter Eisentraut <peter_e@gmx.net> writes:

Tom Lane wrote:

Gen_dummy_probes.sed? How likely is that to work on Windows?

I think if they can run Gen_fmgrtab, they can get this to work.

They can't.

regards, tom lane

#5Peter Eisentraut
peter_e@gmx.net
In reply to: Tom Lane (#4)
Re: pgsql: Enable probes to work with Mac OS X Leopard and other OSes that

Tom Lane wrote:

Peter Eisentraut <peter_e@gmx.net> writes:

Tom Lane wrote:

Gen_dummy_probes.sed? How likely is that to work on Windows?

I think if they can run Gen_fmgrtab, they can get this to work.

They can't.

They can't run Gen_fmgrtab or they can't get this to work?

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#5)
Re: pgsql: Enable probes to work with Mac OS X Leopard and other OSes that

Peter Eisentraut <peter_e@gmx.net> writes:

Tom Lane wrote:

Peter Eisentraut <peter_e@gmx.net> writes:

I think if they can run Gen_fmgrtab, they can get this to work.

They can't.

They can't run Gen_fmgrtab or they can't get this to work?

They can't run Gen_fmgrtab. The MSVC port has its own reimplementation
of that script, and I suppose now it's going to need one to substitute
for this, too.

regards, tom lane

#7Peter Eisentraut
peter_e@gmx.net
In reply to: Tom Lane (#6)
Re: [COMMITTERS] pgsql: Enable probes to work with Mac OS X Leopard and other OSes that

Tom Lane wrote:

Peter Eisentraut <peter_e@gmx.net> writes:

Tom Lane wrote:

Peter Eisentraut <peter_e@gmx.net> writes:

I think if they can run Gen_fmgrtab, they can get this to work.

They can't.

They can't run Gen_fmgrtab or they can't get this to work?

They can't run Gen_fmgrtab. The MSVC port has its own reimplementation
of that script, and I suppose now it's going to need one to substitute
for this, too.

Well, yes. I meant to say, a build system that can supply the functionality
of Gen_fmgrtab can surely implement this new thing. I see there is Perl
being used, so it should be simple.

#8Dave Page
dpage@pgadmin.org
In reply to: Peter Eisentraut (#1)
Re: [COMMITTERS] pgsql: Enable probes to work with Mac OS X Leopard and other OSes that

On Mon, Mar 17, 2008 at 7:44 PM, Peter Eisentraut <petere@postgresql.org> wrote:

Log Message:
-----------
Enable probes to work with Mac OS X Leopard and other OSes that will
support DTrace in the future.

Switch from using DTRACE_PROBEn macros to the dynamically generated macros.
Use "dtrace -h" to create a header file that contains the dynamically
generated macros to be used in the source code instead of the DTRACE_PROBEn
macros. A dummy header file is generated for builds without DTrace support.

Do we need some support in the buildfarm to create the header file?

--
Dave Page
EnterpriseDB UK Ltd: http://www.enterprisedb.com
PostgreSQL UK 2008 Conference: http://www.postgresql.org.uk

#9Peter Eisentraut
peter_e@gmx.net
In reply to: Dave Page (#8)
Re: [COMMITTERS] pgsql: Enable probes to work with Mac OS X Leopard and other OSes that

Am Dienstag, 18. M�rz 2008 schrieb Dave Page:

On Mon, Mar 17, 2008 at 7:44 PM, Peter Eisentraut <petere@postgresql.org>

wrote:

Log Message:
-----------
Enable probes to work with Mac OS X Leopard and other OSes that will
support DTrace in the future.

Switch from using DTRACE_PROBEn macros to the dynamically generated
macros. Use "dtrace -h" to create a header file that contains the
dynamically generated macros to be used in the source code instead of the
DTRACE_PROBEn macros. A dummy header file is generated for builds
without DTrace support.

Do we need some support in the buildfarm to create the header file?

The Windows/MSVC build system needs some adjustments. I have no idea how it
works, but I'd be glad to explain the details to someone who does.

#10Dave Page
dpage@pgadmin.org
In reply to: Peter Eisentraut (#9)
Re: [COMMITTERS] pgsql: Enable probes to work with Mac OS X Leopard and other OSes that

On Tue, Mar 18, 2008 at 9:40 AM, Peter Eisentraut <peter_e@gmx.net> wrote:

Do we need some support in the buildfarm to create the header file?

The Windows/MSVC build system needs some adjustments. I have no idea how it
works, but I'd be glad to explain the details to someone who does.

I was actually thinking of the OS X buildfarm member I setup to
exercise this. From your description it sounded like we need to
generate the probe header manually if we enable dtrace.

I'm sure Magnus would love to hear the details for the MSVC perl scipts :-p

--
Dave Page
EnterpriseDB UK Ltd: http://www.enterprisedb.com
PostgreSQL UK 2008 Conference: http://www.postgresql.org.uk

#11Peter Eisentraut
peter_e@gmx.net
In reply to: Dave Page (#10)
Re: [COMMITTERS] pgsql: Enable probes to work with Mac OS X Leopard and other OSes that

Am Dienstag, 18. M�rz 2008 schrieb Dave Page:

I was actually thinking of the OS X buildfarm member I setup to
exercise this. From your description it sounded like we need to
generate the probe header manually if we enable dtrace.

Nope.

#12Dave Page
dpage@pgadmin.org
In reply to: Peter Eisentraut (#11)
Re: [COMMITTERS] pgsql: Enable probes to work with Mac OS X Leopard and other OSes that

On Tue, Mar 18, 2008 at 11:48 AM, Peter Eisentraut <peter_e@gmx.net> wrote:

Am Dienstag, 18. März 2008 schrieb Dave Page:

I was actually thinking of the OS X buildfarm member I setup to
exercise this. From your description it sounded like we need to
generate the probe header manually if we enable dtrace.

Nope.

OK, I'll enable it on antelope then.

Shouldn't there have been a doc patch with this as well? Last time I
read the docs they said only Solaris supports dtrace.

--
Dave Page
EnterpriseDB UK Ltd: http://www.enterprisedb.com
PostgreSQL UK 2008 Conference: http://www.postgresql.org.uk

#13Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Dave Page (#12)
Re: [COMMITTERS] pgsql: Enable probes to work with Mac OS X Leopard and other OSes that

Dave Page wrote:

Shouldn't there have been a doc patch with this as well? Last time I
read the docs they said only Solaris supports dtrace.

Well, it won't support anything else until somebody tries debugs it ;-)

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

#14Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#13)
Re: [COMMITTERS] pgsql: Enable probes to work with Mac OS X Leopard and other OSes that

Alvaro Herrera <alvherre@commandprompt.com> writes:

Dave Page wrote:

Shouldn't there have been a doc patch with this as well? Last time I
read the docs they said only Solaris supports dtrace.

Well, it won't support anything else until somebody tries debugs it ;-)

Well, I've got Leopard here, I'd be happy to test it ... but the patch
has rendered
http://developer.postgresql.org/pgdocs/postgres/dynamic-trace.html
into a pack of lies quite independently of which OSes are supported,
so I'm not very sure what to do.

regards, tom lane

#15Peter Eisentraut
peter_e@gmx.net
In reply to: Tom Lane (#14)
Re: [COMMITTERS] pgsql: Enable probes to work with Mac OS X Leopard and other OSes that

Am Dienstag, 18. M�rz 2008 schrieb Tom Lane:

Well, I've got Leopard here, I'd be happy to test it ... but the patch
has rendered
http://developer.postgresql.org/pgdocs/postgres/dynamic-trace.html
into a pack of lies quite independently of which OSes are supported,
so I'm not very sure what to do.

Ah yes. Robert, do you think you could update the documentation a bit on how
to use the tracing?

#16Robert Lor
Robert.Lor@Sun.COM
In reply to: Peter Eisentraut (#7)
Re: [COMMITTERS] pgsql: Enable probes to work with Mac OS X Leopard and other OSes that

Peter Eisentraut wrote:

Well, yes. I meant to say, a build system that can supply the functionality
of Gen_fmgrtab can surely implement this new thing. I see there is Perl
being used, so it should be simple.

I was thinking of using a Perl script to generate the dummy header file
but decided against it to avoid disrupting the build on other platforms.
If sed doesn't work on Windows for some reason, we can use a Perl script
instead.

Regards,
-Robert

#17Robert Lor
Robert.Lor@Sun.COM
In reply to: Peter Eisentraut (#1)
Re: pgsql: Enable probes to work with Mac OS X Leopard and other OSes that

Peter Eisentraut wrote:

Modified Files:
--------------
pgsql/src/backend:
Makefile (r1.127 -> r1.128)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/Makefile?r1=1.127&amp;r2=1.128)
pgsql/src/backend/access/transam:
xact.c (r1.259 -> r1.260)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/xact.c?r1=1.259&amp;r2=1.260)
pgsql/src/backend/storage/lmgr:
lock.c (r1.182 -> r1.183)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/lmgr/lock.c?r1=1.182&amp;r2=1.183)
lwlock.c (r1.50 -> r1.51)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/lmgr/lwlock.c?r1=1.50&amp;r2=1.51)
pgsql/src/backend/utils:
Makefile (r1.26 -> r1.27)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/Makefile?r1=1.26&amp;r2=1.27)
pgsql/src/include:
Makefile (r1.23 -> r1.24)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/Makefile?r1=1.23&amp;r2=1.24)
c.h (r1.223 -> r1.224)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/c.h?r1=1.223&amp;r2=1.224)
pg_trace.h (r1.3 -> r1.4)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/pg_trace.h?r1=1.3&amp;r2=1.4)

Added Files:
-----------
pgsql/src/backend/utils:
Gen_dummy_probes.sed (r1.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/Gen_dummy_probes.sed?rev=1.1&amp;content-type=text/x-cvsweb-markup)

You didn't include the changes in pgsql/src/Makefile. By generating
probes.h before the compile starts, it will allow probes to be added
outside the backend without having to do anything extra. Is this not the
right way or you think it's not needed now?

Regards,
-Robert

#18Robert Lor
Robert.Lor@Sun.COM
In reply to: Peter Eisentraut (#15)
Re: [COMMITTERS] pgsql: Enable probes to work with Mac OS X Leopard and other OSes that

Peter Eisentraut wrote:

Am Dienstag, 18. M�rz 2008 schrieb Tom Lane:

Well, I've got Leopard here, I'd be happy to test it ... but the patch
has rendered
http://developer.postgresql.org/pgdocs/postgres/dynamic-trace.html
into a pack of lies quite independently of which OSes are supported,
so I'm not very sure what to do.

Ah yes. Robert, do you think you could update the documentation a bit on how
to use the tracing?

Yes, the doc needs to be updated. Will submit a patch soon!

Regards,
-Robert

#19Peter Eisentraut
peter_e@gmx.net
In reply to: Robert Lor (#17)
Re: pgsql: Enable probes to work with Mac OS X Leopard and other OSes that

Robert Lor wrote:

You didn't include the changes in pgsql/src/Makefile. �By generating
probes.h before the compile starts, it will allow probes to be added
outside the backend without having to do anything extra. Is this not the
right way or you think it's not needed now?

Once we have that situation, we can think about the right way to implement it.
Worst case, we just put the hunk back. But it is not needed now.

#20Andrew Dunstan
andrew@dunslane.net
In reply to: Robert Lor (#16)
Re: [COMMITTERS] pgsql: Enable probes to work with Mac OS X Leopard and other OSes that

Robert Lor wrote:

Peter Eisentraut wrote:

Well, yes. I meant to say, a build system that can supply the
functionality of Gen_fmgrtab can surely implement this new thing. I
see there is Perl being used, so it should be simple.

I was thinking of using a Perl script to generate the dummy header
file but decided against it to avoid disrupting the build on other
platforms. If sed doesn't work on Windows for some reason, we can use
a Perl script instead.

Perl is required for all MSVC builds, and for all builds from CVS on any
platform too, IIRC, so it's a fairly safe bet for any tool you provide.

cheers

andrew

#21Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#20)
#22Joshua D. Drake
jd@commandprompt.com
In reply to: Tom Lane (#21)
#23Peter Eisentraut
peter_e@gmx.net
In reply to: Joshua D. Drake (#22)
#24Joshua D. Drake
jd@commandprompt.com
In reply to: Peter Eisentraut (#23)
#25Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#23)
#26Andrew Dunstan
andrew@dunslane.net
In reply to: Robert Lor (#16)
#27Magnus Hagander
magnus@hagander.net
In reply to: Andrew Dunstan (#26)
#28Andrew Dunstan
andrew@dunslane.net
In reply to: Magnus Hagander (#27)