diff -cprN HEAD/src/backend/commands/explain.c pg_stat_statements/src/backend/commands/explain.c
*** HEAD/src/backend/commands/explain.c	Sat Nov 22 11:15:56 2008
--- pg_stat_statements/src/backend/commands/explain.c	Fri Dec 12 18:26:03 2008
***************
*** 33,38 ****
--- 33,41 ----
  #include "utils/snapmgr.h"
  
  
+ /* GUC parameter */
+ char *explain_analyze_format;
+ 
  /* Hook for plugins to get control in ExplainOneQuery() */
  ExplainOneQuery_hook_type ExplainOneQuery_hook = NULL;
  
*************** static void show_sort_keys(Plan *sortpla
*** 73,78 ****
--- 76,82 ----
  static void show_sort_info(SortState *sortstate,
  			   StringInfo str, int indent, ExplainState *es);
  static const char *explain_get_index_name(Oid indexId);
+ static void appendInstrument(StringInfo str, const Instrumentation *instr);
  
  
  /*
*************** report_triggers(ResultRelInfo *rInfo, bo
*** 396,403 ****
  			appendStringInfo(buf, " on %s",
  							 RelationGetRelationName(rInfo->ri_RelationDesc));
  
! 		appendStringInfo(buf, ": time=%.3f calls=%.0f\n",
  						 1000.0 * instr->total, instr->ntuples);
  	}
  }
  
--- 401,410 ----
  			appendStringInfo(buf, " on %s",
  							 RelationGetRelationName(rInfo->ri_RelationDesc));
  
! 		appendStringInfo(buf, ": time=%.3f calls=%.0f",
  						 1000.0 * instr->total, instr->ntuples);
+ 		appendInstrument(buf, instr);
+ 		appendStringInfoChar(buf, '\n');
  	}
  }
  
*************** explain_outNode(StringInfo str,
*** 801,811 ****
  	{
  		double		nloops = planstate->instrument->nloops;
  
! 		appendStringInfo(str, " (actual time=%.3f..%.3f rows=%.0f loops=%.0f)",
  						 1000.0 * planstate->instrument->startup / nloops,
  						 1000.0 * planstate->instrument->total / nloops,
  						 planstate->instrument->ntuples / nloops,
  						 planstate->instrument->nloops);
  	}
  	else if (es->printAnalyze)
  		appendStringInfo(str, " (never executed)");
--- 808,820 ----
  	{
  		double		nloops = planstate->instrument->nloops;
  
! 		appendStringInfo(str, " (actual time=%.3f..%.3f rows=%.0f loops=%.0f",
  						 1000.0 * planstate->instrument->startup / nloops,
  						 1000.0 * planstate->instrument->total / nloops,
  						 planstate->instrument->ntuples / nloops,
  						 planstate->instrument->nloops);
+ 		appendInstrument(str, planstate->instrument);
+ 		appendStringInfoChar(str, ')');
  	}
  	else if (es->printAnalyze)
  		appendStringInfo(str, " (never executed)");
*************** explain_get_index_name(Oid indexId)
*** 1335,1338 ****
--- 1344,1423 ----
  		result = quote_identifier(result);
  	}
  	return result;
+ }
+ 
+ /*
+  * append formatted instrumentation to the provided buffer.
+  */
+ static void
+ appendInstrument(StringInfo buf, const Instrumentation *instr)
+ {
+ 	int			format_len;
+ 	int			i;
+ 
+ 	format_len = strlen(explain_analyze_format);
+ 
+ 	for (i = 0; i < format_len; i++)
+ 	{
+ 		if (explain_analyze_format[i] != '%')
+ 		{
+ 			/* literal char, just copy */
+ 			appendStringInfoChar(buf, explain_analyze_format[i]);
+ 			continue;
+ 		}
+ 		/* go to char after '%' */
+ 		i++;
+ 		if (i >= format_len)
+ 			break;				/* format error - ignore it */
+ 
+ 		/* process the option */
+ 		switch (explain_analyze_format[i])
+ 		{
+ 			case 'g':
+ 				appendStringInfo(buf, "%ld", instr->buffer.shared_gets);
+ 				break;
+ 			case 'h':
+ 				appendStringInfo(buf, "%ld", instr->buffer.shared_hits);
+ 				break;
+ 			case 'r':
+ 				appendStringInfo(buf, "%ld", instr->buffer.shared_gets - instr->buffer.shared_hits);
+ 				break;
+ 			case 'w':
+ 				appendStringInfo(buf, "%ld", instr->buffer.shared_writes);
+ 				break;
+ 			case 'G':
+ 				appendStringInfo(buf, "%ld", instr->buffer.local_gets);
+ 				break;
+ 			case 'H':
+ 				appendStringInfo(buf, "%ld", instr->buffer.local_hits);
+ 				break;
+ 			case 'R':
+ 				appendStringInfo(buf, "%ld", instr->buffer.local_gets - instr->buffer.local_hits);
+ 				break;
+ 			case 'W':
+ 				appendStringInfo(buf, "%ld", instr->buffer.local_writes);
+ 				break;
+ 			case 't':
+ 				appendStringInfo(buf, "%ld", instr->buffer.buffile_reads);
+ 				break;
+ 			case 'T':
+ 				appendStringInfo(buf, "%ld", instr->buffer.buffile_writes);
+ 				break;
+ 			case 'p':
+ 				appendStringInfo(buf, "%.2f", 1000.0 * (instr->utime + instr->stime));
+ 				break;
+ 			case 'u':
+ 				appendStringInfo(buf, "%.2f", 1000.0 * instr->utime);
+ 				break;
+ 			case 's':
+ 				appendStringInfo(buf, "%.2f", 1000.0 * instr->stime);
+ 				break;
+ 			case '%':
+ 				appendStringInfoChar(buf, '%');
+ 				break;
+ 			default:
+ 				/* format error - ignore it */
+ 				break;
+ 		}
+ 	}
  }
diff -cprN HEAD/src/backend/executor/instrument.c pg_stat_statements/src/backend/executor/instrument.c
*** HEAD/src/backend/executor/instrument.c	Sat Nov  1 15:22:28 2008
--- pg_stat_statements/src/backend/executor/instrument.c	Fri Dec 12 18:26:03 2008
***************
*** 14,22 ****
--- 14,31 ----
  #include "postgres.h"
  
  #include <unistd.h>
+ #ifdef HAVE_SYS_RESOURCE_H
+ #include <sys/time.h>
+ #include <sys/resource.h>
+ #endif
+ 
+ #ifndef HAVE_GETRUSAGE
+ #include "rusagestub.h"
+ #endif
  
  #include "executor/instrument.h"
  
+ #define timeval_to_sec(t) 	((double) (t).tv_sec + (t).tv_usec / 1000000.0)
  
  /* Allocate new instrumentation structure(s) */
  Instrumentation *
*************** void
*** 34,40 ****
--- 43,59 ----
  InstrStartNode(Instrumentation *instr)
  {
  	if (INSTR_TIME_IS_ZERO(instr->starttime))
+ 	{
+ 		struct rusage	ru;
+ 
  		INSTR_TIME_SET_CURRENT(instr->starttime);
+ 
+ 		BufferCounterSub(&instr->buffer, &BufferStats);
+ 
+ 		getrusage(RUSAGE_SELF, &ru);
+ 		instr->utime -= timeval_to_sec(ru.ru_utime);
+ 		instr->stime -= timeval_to_sec(ru.ru_stime);
+ 	}
  	else
  		elog(DEBUG2, "InstrStartNode called twice in a row");
  }
*************** void
*** 44,49 ****
--- 63,69 ----
  InstrStopNode(Instrumentation *instr, double nTuples)
  {
  	instr_time	endtime;
+ 	struct rusage	ru;
  
  	/* count the returned tuples */
  	instr->tuplecount += nTuples;
*************** InstrStopNode(Instrumentation *instr, do
*** 56,61 ****
--- 76,87 ----
  
  	INSTR_TIME_SET_CURRENT(endtime);
  	INSTR_TIME_ACCUM_DIFF(instr->counter, endtime, instr->starttime);
+ 
+ 	BufferCounterAdd(&instr->buffer, &BufferStats);
+ 
+ 	getrusage(RUSAGE_SELF, &ru);
+ 	instr->utime += timeval_to_sec(ru.ru_utime);
+ 	instr->stime += timeval_to_sec(ru.ru_stime);
  
  	INSTR_TIME_SET_ZERO(instr->starttime);
  
diff -cprN HEAD/src/backend/storage/buffer/buf_init.c pg_stat_statements/src/backend/storage/buffer/buf_init.c
*** HEAD/src/backend/storage/buffer/buf_init.c	Sat Nov  1 15:22:28 2008
--- pg_stat_statements/src/backend/storage/buffer/buf_init.c	Fri Dec 12 18:26:03 2008
*************** char	   *BufferBlocks;
*** 23,37 ****
  int32	   *PrivateRefCount;
  
  /* statistics counters */
! long int	ReadBufferCount;
! long int	ReadLocalBufferCount;
! long int	BufferHitCount;
! long int	LocalBufferHitCount;
! long int	BufferFlushCount;
! long int	LocalBufferFlushCount;
! long int	BufFileReadCount;
! long int	BufFileWriteCount;
  
  
  /*
   * Data Structures:
--- 23,55 ----
  int32	   *PrivateRefCount;
  
  /* statistics counters */
! BufferCounter	BufferStats;
  
+ void
+ BufferCounterAdd(BufferCounter *into, const BufferCounter *arg)
+ {
+ 	into->shared_gets += arg->shared_gets;
+ 	into->shared_hits += arg->shared_hits;
+ 	into->shared_writes += arg->shared_writes;
+ 	into->local_gets += arg->local_gets;
+ 	into->local_hits += arg->local_hits;
+ 	into->local_writes += arg->local_writes;
+ 	into->buffile_reads += arg->buffile_reads;
+ 	into->buffile_writes += arg->buffile_writes;
+ }
+ 
+ void
+ BufferCounterSub(BufferCounter *into, const BufferCounter *arg)
+ {
+ 	into->shared_gets -= arg->shared_gets;
+ 	into->shared_hits -= arg->shared_hits;
+ 	into->shared_writes -= arg->shared_writes;
+ 	into->local_gets -= arg->local_gets;
+ 	into->local_hits -= arg->local_hits;
+ 	into->local_writes -= arg->local_writes;
+ 	into->buffile_reads -= arg->buffile_reads;
+ 	into->buffile_writes -= arg->buffile_writes;
+ }
  
  /*
   * Data Structures:
diff -cprN HEAD/src/backend/storage/buffer/bufmgr.c pg_stat_statements/src/backend/storage/buffer/bufmgr.c
*** HEAD/src/backend/storage/buffer/bufmgr.c	Sat Nov 22 11:15:56 2008
--- pg_stat_statements/src/backend/storage/buffer/bufmgr.c	Fri Dec 12 18:26:03 2008
*************** double		bgwriter_lru_multiplier = 2.0;
*** 69,74 ****
--- 69,77 ----
  static volatile BufferDesc *InProgressBuf = NULL;
  static bool IsForInput;
  
+ /* baseline of buffer counters */
+ static BufferCounter	BufferStats_base;
+ 
  /* local state for LockBufferForCleanup */
  static volatile BufferDesc *PinCountWaitBuf = NULL;
  
*************** ReadBuffer_common(SMgrRelation smgr, boo
*** 208,218 ****
  
  	if (isLocalBuf)
  	{
! 		ReadLocalBufferCount++;
  		bufHdr = LocalBufferAlloc(smgr, forkNum, blockNum, &found);
  		if (found)
  		{
! 			LocalBufferHitCount++;
  			TRACE_POSTGRESQL_BUFFER_HIT(true); /* true == local buffer */
  		}
  		else
--- 211,221 ----
  
  	if (isLocalBuf)
  	{
! 		BufferStats.local_gets++;
  		bufHdr = LocalBufferAlloc(smgr, forkNum, blockNum, &found);
  		if (found)
  		{
! 			BufferStats.local_hits++;
  			TRACE_POSTGRESQL_BUFFER_HIT(true); /* true == local buffer */
  		}
  		else
*************** ReadBuffer_common(SMgrRelation smgr, boo
*** 222,228 ****
  	}
  	else
  	{
! 		ReadBufferCount++;
  
  		/*
  		 * lookup the buffer.  IO_IN_PROGRESS is set if the requested block is
--- 225,231 ----
  	}
  	else
  	{
! 		BufferStats.shared_gets++;
  
  		/*
  		 * lookup the buffer.  IO_IN_PROGRESS is set if the requested block is
*************** ReadBuffer_common(SMgrRelation smgr, boo
*** 231,237 ****
  		bufHdr = BufferAlloc(smgr, forkNum, blockNum, strategy, &found);
  		if (found)
  		{
! 			BufferHitCount++;
  			TRACE_POSTGRESQL_BUFFER_HIT(false); /* false != local buffer */
  		}
  		else
--- 234,240 ----
  		bufHdr = BufferAlloc(smgr, forkNum, blockNum, strategy, &found);
  		if (found)
  		{
! 			BufferStats.shared_hits++;
  			TRACE_POSTGRESQL_BUFFER_HIT(false); /* false != local buffer */
  		}
  		else
*************** ShowBufferUsage(void)
*** 1524,1551 ****
  	StringInfoData str;
  	float		hitrate;
  	float		localhitrate;
  
  	initStringInfo(&str);
  
! 	if (ReadBufferCount == 0)
  		hitrate = 0.0;
  	else
! 		hitrate = (float) BufferHitCount *100.0 / ReadBufferCount;
  
! 	if (ReadLocalBufferCount == 0)
  		localhitrate = 0.0;
  	else
! 		localhitrate = (float) LocalBufferHitCount *100.0 / ReadLocalBufferCount;
  
  	appendStringInfo(&str,
  	"!\tShared blocks: %10ld read, %10ld written, buffer hit rate = %.2f%%\n",
! 				ReadBufferCount - BufferHitCount, BufferFlushCount, hitrate);
  	appendStringInfo(&str,
  	"!\tLocal  blocks: %10ld read, %10ld written, buffer hit rate = %.2f%%\n",
! 					 ReadLocalBufferCount - LocalBufferHitCount, LocalBufferFlushCount, localhitrate);
  	appendStringInfo(&str,
  					 "!\tDirect blocks: %10ld read, %10ld written\n",
! 					 BufFileReadCount, BufFileWriteCount);
  
  	return str.data;
  }
--- 1527,1557 ----
  	StringInfoData str;
  	float		hitrate;
  	float		localhitrate;
+ 	BufferCounter	c = BufferStats;
+ 
+ 	BufferCounterSub(&c, &BufferStats_base);
  
  	initStringInfo(&str);
  
! 	if (c.shared_gets == 0)
  		hitrate = 0.0;
  	else
! 		hitrate = c.shared_hits * 100.0f / c.shared_gets;
  
! 	if (c.local_gets == 0)
  		localhitrate = 0.0;
  	else
! 		localhitrate = c.local_hits * 100.0f / c.local_gets;
  
  	appendStringInfo(&str,
  	"!\tShared blocks: %10ld read, %10ld written, buffer hit rate = %.2f%%\n",
! 				c.shared_gets - c.shared_hits, c.shared_writes, hitrate);
  	appendStringInfo(&str,
  	"!\tLocal  blocks: %10ld read, %10ld written, buffer hit rate = %.2f%%\n",
! 				c.local_gets - c.local_hits, c.local_writes, localhitrate);
  	appendStringInfo(&str,
  					 "!\tDirect blocks: %10ld read, %10ld written\n",
! 					 c.buffile_reads, c.buffile_writes);
  
  	return str.data;
  }
*************** ShowBufferUsage(void)
*** 1553,1566 ****
  void
  ResetBufferUsage(void)
  {
! 	BufferHitCount = 0;
! 	ReadBufferCount = 0;
! 	BufferFlushCount = 0;
! 	LocalBufferHitCount = 0;
! 	ReadLocalBufferCount = 0;
! 	LocalBufferFlushCount = 0;
! 	BufFileReadCount = 0;
! 	BufFileWriteCount = 0;
  }
  
  /*
--- 1559,1565 ----
  void
  ResetBufferUsage(void)
  {
! 	BufferStats_base = BufferStats;
  }
  
  /*
*************** FlushBuffer(volatile BufferDesc *buf, SM
*** 1818,1824 ****
  			  (char *) BufHdrGetBlock(buf),
  			  false);
  
! 	BufferFlushCount++;
  
  	TRACE_POSTGRESQL_BUFFER_FLUSH_DONE(reln->smgr_rnode.spcNode,
  		 reln->smgr_rnode.dbNode, reln->smgr_rnode.relNode);
--- 1817,1823 ----
  			  (char *) BufHdrGetBlock(buf),
  			  false);
  
! 	BufferStats.shared_writes++;
  
  	TRACE_POSTGRESQL_BUFFER_FLUSH_DONE(reln->smgr_rnode.spcNode,
  		 reln->smgr_rnode.dbNode, reln->smgr_rnode.relNode);
diff -cprN HEAD/src/backend/storage/buffer/localbuf.c pg_stat_statements/src/backend/storage/buffer/localbuf.c
*** HEAD/src/backend/storage/buffer/localbuf.c	Fri Dec  5 00:11:18 2008
--- pg_stat_statements/src/backend/storage/buffer/localbuf.c	Fri Dec 12 18:26:03 2008
*************** LocalBufferAlloc(SMgrRelation smgr, Fork
*** 172,178 ****
  		/* Mark not-dirty now in case we error out below */
  		bufHdr->flags &= ~BM_DIRTY;
  
! 		LocalBufferFlushCount++;
  	}
  
  	/*
--- 172,178 ----
  		/* Mark not-dirty now in case we error out below */
  		bufHdr->flags &= ~BM_DIRTY;
  
! 		BufferStats.local_writes++;
  	}
  
  	/*
diff -cprN HEAD/src/backend/storage/file/buffile.c pg_stat_statements/src/backend/storage/file/buffile.c
*** HEAD/src/backend/storage/file/buffile.c	Sat Nov  1 15:22:28 2008
--- pg_stat_statements/src/backend/storage/file/buffile.c	Fri Dec 12 18:26:03 2008
*************** BufFileLoadBuffer(BufFile *file)
*** 240,246 ****
  	file->offsets[file->curFile] += file->nbytes;
  	/* we choose not to advance curOffset here */
  
! 	BufFileReadCount++;
  }
  
  /*
--- 240,246 ----
  	file->offsets[file->curFile] += file->nbytes;
  	/* we choose not to advance curOffset here */
  
! 	BufferStats.buffile_reads++;
  }
  
  /*
*************** BufFileDumpBuffer(BufFile *file)
*** 304,310 ****
  		file->curOffset += bytestowrite;
  		wpos += bytestowrite;
  
! 		BufFileWriteCount++;
  	}
  	file->dirty = false;
  
--- 304,310 ----
  		file->curOffset += bytestowrite;
  		wpos += bytestowrite;
  
! 		BufferStats.buffile_writes++;
  	}
  	file->dirty = false;
  
diff -cprN HEAD/src/backend/utils/misc/guc.c pg_stat_statements/src/backend/utils/misc/guc.c
*** HEAD/src/backend/utils/misc/guc.c	Fri Dec  5 00:11:18 2008
--- pg_stat_statements/src/backend/utils/misc/guc.c	Fri Dec 12 18:26:03 2008
*************** extern char *default_tablespace;
*** 113,118 ****
--- 113,119 ----
  extern char *temp_tablespaces;
  extern bool synchronize_seqscans;
  extern bool fullPageWrites;
+ extern char *explain_analyze_format;
  
  #ifdef TRACE_SORT
  extern bool trace_sort;
*************** static struct config_string ConfigureNam
*** 2493,2498 ****
--- 2494,2508 ----
  	},
  #endif   /* USE_SSL */
  
+ 	{
+ 		{"explain_analyze_format", PGC_USERSET, CLIENT_CONN_STATEMENT,
+ 			gettext_noop("Controls information returned in explain analyze."),
+ 			gettext_noop("If blank, basic statistics are returned.")
+ 		},
+ 		&explain_analyze_format,
+ 		"", NULL, NULL
+ 	},
+ 
  	/* End-of-list marker */
  	{
  		{NULL, 0, 0, NULL, NULL}, NULL, NULL, NULL, NULL
*************** define_custom_variable(struct config_gen
*** 5707,5713 ****
  		case PGC_S_ENV_VAR:
  		case PGC_S_FILE:
  		case PGC_S_ARGV:
! 			phcontext = PGC_SIGHUP;
  			break;
  		case PGC_S_DATABASE:
  		case PGC_S_USER:
--- 5717,5726 ----
  		case PGC_S_ENV_VAR:
  		case PGC_S_FILE:
  		case PGC_S_ARGV:
! 			if (variable->context == PGC_POSTMASTER)
! 				phcontext = PGC_POSTMASTER;
! 			else
! 				phcontext = PGC_SIGHUP;
  			break;
  		case PGC_S_DATABASE:
  		case PGC_S_USER:
diff -cprN HEAD/src/backend/utils/misc/postgresql.conf.sample pg_stat_statements/src/backend/utils/misc/postgresql.conf.sample
*** HEAD/src/backend/utils/misc/postgresql.conf.sample	Fri Nov 14 21:39:34 2008
--- pg_stat_statements/src/backend/utils/misc/postgresql.conf.sample	Fri Dec 12 18:26:03 2008
***************
*** 443,448 ****
--- 443,450 ----
  # default configuration for text search
  #default_text_search_config = 'pg_catalog.simple'
  
+ #explain_analyze_format = ''	# special values %[ghrwGHRWtTpus%]
+ 
  # - Other Defaults -
  
  #dynamic_library_path = '$libdir'
diff -cprN HEAD/src/include/executor/instrument.h pg_stat_statements/src/include/executor/instrument.h
*** HEAD/src/include/executor/instrument.h	Sat Nov  1 15:22:28 2008
--- pg_stat_statements/src/include/executor/instrument.h	Fri Dec 12 18:26:03 2008
***************
*** 14,19 ****
--- 14,20 ----
  #define INSTRUMENT_H
  
  #include "portability/instr_time.h"
+ #include "storage/buf_internals.h"
  
  
  typedef struct Instrumentation
*************** typedef struct Instrumentation
*** 29,34 ****
--- 30,39 ----
  	double		total;			/* Total total time (in seconds) */
  	double		ntuples;		/* Total tuples produced */
  	double		nloops;			/* # of run cycles for this node */
+ 
+ 	BufferCounter	buffer;		/* buffer stats */
+ 	double		utime;			/* user time in sec */
+ 	double		stime;			/* sys time in sec */
  } Instrumentation;
  
  extern Instrumentation *InstrAlloc(int n);
diff -cprN HEAD/src/include/pgstat.h pg_stat_statements/src/include/pgstat.h
*** HEAD/src/include/pgstat.h	Fri Nov 14 21:39:34 2008
--- pg_stat_statements/src/include/pgstat.h	Fri Dec 12 18:26:03 2008
*************** typedef struct PgStat_FunctionCallUsage
*** 591,597 ****
  extern bool pgstat_track_activities;
  extern bool pgstat_track_counts;
  extern int	pgstat_track_functions;
! extern int	pgstat_track_activity_query_size;
  extern char *pgstat_stat_tmpname;
  extern char *pgstat_stat_filename;
  
--- 591,597 ----
  extern bool pgstat_track_activities;
  extern bool pgstat_track_counts;
  extern int	pgstat_track_functions;
! extern PGDLLIMPORT int	pgstat_track_activity_query_size;
  extern char *pgstat_stat_tmpname;
  extern char *pgstat_stat_filename;
  
diff -cprN HEAD/src/include/storage/buf_internals.h pg_stat_statements/src/include/storage/buf_internals.h
*** HEAD/src/include/storage/buf_internals.h	Sat Nov  1 15:22:28 2008
--- pg_stat_statements/src/include/storage/buf_internals.h	Fri Dec 12 18:26:03 2008
*************** extern PGDLLIMPORT BufferDesc *BufferDes
*** 174,188 ****
  extern BufferDesc *LocalBufferDescriptors;
  
  /* event counters in buf_init.c */
! extern long int ReadBufferCount;
! extern long int ReadLocalBufferCount;
! extern long int BufferHitCount;
! extern long int LocalBufferHitCount;
! extern long int BufferFlushCount;
! extern long int LocalBufferFlushCount;
! extern long int BufFileReadCount;
! extern long int BufFileWriteCount;
  
  
  /*
   * Internal routines: only called by bufmgr
--- 174,195 ----
  extern BufferDesc *LocalBufferDescriptors;
  
  /* event counters in buf_init.c */
! typedef struct BufferCounter
! {
! 	long	shared_gets;
! 	long	shared_hits;
! 	long	shared_writes;
! 	long	local_gets;
! 	long	local_hits;
! 	long	local_writes;
! 	long	buffile_reads;
! 	long	buffile_writes;
! } BufferCounter;
  
+ extern PGDLLIMPORT BufferCounter	BufferStats;
+ 
+ extern void	BufferCounterAdd(BufferCounter *into, const BufferCounter *arg);
+ extern void	BufferCounterSub(BufferCounter *into, const BufferCounter *arg);
  
  /*
   * Internal routines: only called by bufmgr
