Re: [PATCHES] Patch to log usage of temporary files - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCHES] Patch to log usage of temporary files
Date
Msg-id 10830.1168379458@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCHES] Patch to log usage of temporary files  (Bruce Momjian <bruce@momjian.us>)
Responses Re: [PATCHES] Patch to log usage of temporary files  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
Bruce Momjian <bruce@momjian.us> writes:
> +         A value of zero logs all temporary files, and positive
> +         values log only files whose size is equal or greater than
> +         the specified number of bytes.

Surely the measurement unit should be kbytes or disk blocks.  And why
aren't you using that GUC UNITS infrastructure Peter put in?

>           /* reset flag so that die() interrupt won't cause problems */
>           vfdP->fdstate &= ~FD_TEMPORARY;
> +         PG_TRACE1(temp__file__cleanup, vfdP->fileName);
> +         if (log_temp_files >= 0)
> +         {
> +             if (stat(vfdP->fileName, &filestats) == 0)

The TRACE is in the wrong place no?  I thought it was going to be after
the stat() operation so it could pass the file size.

Also, I dunno much about DTrace, but I had the idea that you can't
simply throw a PG_TRACE macro into the source and think you are done
--- isn't there a file of probe declarations to add to?  Not to mention
the documentation of what probes exist.

            regards, tom lane

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Dynamically sizing FSM?
Next
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] Patch to log usage of temporary files