Re: [HACKERS] Patch to log usage of temporary files

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Bill Moran <wmoran(at)collaborativefusion(dot)com>, pgsql-hackers(at)postgresql(dot)org, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] Patch to log usage of temporary files
Date: 2007-01-09 21:50:58
Message-ID: 10830.1168379458@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Bruce Momjian <bruce(at)momjian(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2007-01-09 22:01:05 Re: Last infomask bit
Previous Message Tom Lane 2007-01-09 21:38:47 Re: Dynamically sizing FSM?

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2007-01-09 22:01:05 Re: Last infomask bit
Previous Message Bill Moran 2007-01-09 21:33:59 Re: [HACKERS] Patch to log usage of temporary files