Re: Review: DTrace probes (merged version) ver_03

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Robert Lor <Robert(dot)Lor(at)Sun(dot)COM>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>, jesus(at)omniti(dot)com
Subject: Re: Review: DTrace probes (merged version) ver_03
Date: 2008-07-31 18:20:37
Message-ID: 20080731182037.GH8497@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Lor wrote:

Hi,

>> What I suggest might be a reasonable compromise is to copy needed
>> typedefs directly into the probes.d file:

> Implemented this suggestion. There are some weirdness with the OS X
> compiler causing some of the probe declarations not to compile (see
> comments in probe.d). The compiler spits out some warnings because the
> types don't show up in the function prototype in probes.h, but the
> probes work okay. I think we can safely ignore the warnings.

These make sense, because they are already typedef's in our code:

> +typedef unsigned int LocalTransactionId;
> +typedef int LWLockId;
> +typedef int LWLockMode;
> +typedef int LOCKMODE;
> +typedef unsigned int BlockNumber;
> +typedef unsigned int Oid;

But I don't see a reason to define the rest:

> +typedef unsigned int locktag_field2;
> +typedef const char * query_string;
> +typedef int sortType;
> +typedef int trueFalse;
> +typedef int nkeys;
> +typedef int workMem;
> +typedef int randomAccess;
> +typedef unsigned long LogicalTapeSetPtr;
> +typedef long spaceUsed;
> +typedef int isLocalBuf;
> +typedef int found;
> +typedef int flags;
> +typedef int num_to_write;
> +typedef int num_written;
> +typedef int NBuffers;
> +typedef int buf_id;

I think you should add a #define Size, perhaps #define bool, and use
those where applicable, and the plain types (int, long, etc) in the rest.

> + /* The following probe declarations cause compilation errors
> + * on Mac OS X but not on Solaris. Need further investigation.
> + * probe lock__wait__start(locktag_field2, LOCKMODE);
> + * probe lock__wait__done(locktag_field2, LOCKMODE);
> + */
> + probe lock__wait__start(unsigned int, int);
> + probe lock__wait__done(unsigned int, int);

For example I think this should look like

probe lock__wait__start(unsigned int, LOCKMODE);

That Mac OS X problem merits some extra investigation, I think.

Other than this, I think this patch can be committed.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2008-07-31 18:23:53 Re: window function v03 against HEAD
Previous Message Henry B. Hotz 2008-07-31 18:14:29 Re: Plans for 8.4