Skip site navigation (1) Skip section navigation (2)

Re: DTrace probe patch for OS X Leopard

From: Robert Lor <Robert(dot)Lor(at)Sun(dot)COM>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: DTrace probe patch for OS X Leopard
Date: 2008-02-28 04:26:46
Message-ID: 47C63806.70404@sun.com (view raw or flat)
Thread:
Lists: pgsql-patches
Peter Eisentraut wrote:
> I have reworked your build rules so they look more like the idioms that we 
> already use for other similar cases.  This should fix the troubles you 
> describe and others.
>   
There are a couple of problems with your updated patch:

1) utils/probes.h needs to be generated before any file is compiled 
since it's used in c.h and a lot of files include c.h. That's why in my 
previous patch, I had a rule to call "$(DTRACE) -h -s $< -o $@" in 
src/Makefile, and I don't think it will work putting it in 
src/backend/utils/Makefile. If utils/probes.h doesn't exist, you get 
compilation errors right of the bat.

...
gmake -C port all
gmake[2]: Entering directory `/export/home/pgs/src/pgsql/src/port'
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline 
-Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing 
-I../../src/port -DFRONTEND -I../../src/include   -c -o isinf.o isinf.c 
-MMD -MP -MF .deps/isinf.Po
In file included from isinf.c:15:
../../src/include/c.h:60:26: utils/probes.h: No such file or directory
gmake[2]: *** [isinf.o] Error 1
gmake[2]: Leaving directory `/export/home/pgs/src/pgsql/src/port'
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory `/export/home/pgs/src/pgsql/src'
gmake: *** [all] Error 2

It there a simple way to link to src/backend/utils/probes.d from a build 
tree and put the generated probes.h in src/include/utils instead of 
generate probes.h in src/backend/utils and link to in from 
src/include/utils?

2) c.h needs to have an ifdef like below. probes_null.h is attached, and 
this file is static and is used in the case Dtrace is not enabled.

#ifdef ENABLE_DTRACE
#include "utils/probes.h"
#else
#include "utils/probes_null.h"
#endif


Regards,
-Robert

Attachment: probes_null.h
Description: text/plain (1.3 KB)

In response to

Responses

pgsql-patches by date

Next:From: ITAGAKI TakahiroDate: 2008-02-28 08:46:04
Subject: Logging conflicted queries on deadlocks
Previous:From: Tom LaneDate: 2008-02-27 22:42:18
Subject: Re: new warning message

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group