pg_proctab.git
15 years agoadd option to list snapshots
Mark Wong [Sat, 27 Mar 2010 12:42:41 +0000 (05:42 -0700)]
add option to list snapshots

Added a -list flag to list all snapshots and their comments.

15 years agotake notes for a snapshot
Mark Wong [Sat, 27 Mar 2010 12:41:57 +0000 (05:41 -0700)]
take notes for a snapshot

The examples allow for a string to be used to make notes for a snapshot.

15 years agofix commit and rollback calculation
Mark Wong [Sat, 27 Mar 2010 12:40:49 +0000 (05:40 -0700)]
fix commit and rollback calculation

The commit and rollback counts were using the values from the wrong
columns.

15 years agoCombined proc util script with io util script
gabriellew [Sun, 15 Nov 2009 00:40:59 +0000 (16:40 -0800)]
Combined proc util script with io util script

- didn't include stime and utime;  they were unused in the original
- started squashing the psql command into something more modular
(will eventually use the DBI to connect)
- added time calcs
- added a half-hearted attempt at figuring out local Hz kernel value

16 years agoAdded examples of using pg_proctab.
Mark Wong [Fri, 24 Apr 2009 05:56:17 +0000 (22:56 -0700)]
Added examples of using pg_proctab.

16 years agoReverted a Solaris specific change that wasn't supposed to be committed
Mark Wong [Fri, 17 Apr 2009 06:15:32 +0000 (23:15 -0700)]
Reverted a Solaris specific change that wasn't supposed to be committed
yet.

16 years agoMerge branch 'master' of git://git.postgresql.org/git/~markwkm/pg_proctab
Mark Wong [Fri, 27 Mar 2009 05:40:25 +0000 (22:40 -0700)]
Merge branch 'master' of git://git.postgresql.org/git/~markwkm/pg_proctab

16 years agoStop using pgxs and moved to using cmake because platform specific linker
Mark Wong [Fri, 27 Mar 2009 05:31:36 +0000 (22:31 -0700)]
Stop using pgxs and moved to using cmake because platform specific linker
flags will be needed for at least Solaris.  The README has been updated
to describe cmake.

Also made the SQL files static.  This can be changed back so they are
generated when running cmake.

16 years agoUse strncpy instead of strcpy and snprintf instead of sprintf because
Mark Wong [Fri, 27 Mar 2009 02:42:22 +0000 (19:42 -0700)]
Use strncpy instead of strcpy and snprintf instead of sprintf because
they are hopefully safer.

16 years agoAdded functionality to return i/o statistics per process if enabled on
Mark Wong [Fri, 27 Mar 2009 02:41:06 +0000 (19:41 -0700)]
Added functionality to return i/o statistics per process if enabled on
Linux systems.

16 years agoUpdated debug messages for the test of the C stored functions.
Mark Wong [Thu, 26 Mar 2009 01:57:55 +0000 (18:57 -0700)]
Updated debug messages for the test of the C stored functions.

16 years agoDon't change the working directory inside the stored function. That can
Mark Wong [Thu, 26 Mar 2009 00:37:20 +0000 (17:37 -0700)]
Don't change the working directory inside the stored function.  That can
keep the database from functioning properly.

16 years agoAdded additional debugging. Added DEBUG5 message to show what pids are
Mark Wong [Thu, 26 Mar 2009 00:30:31 +0000 (17:30 -0700)]
Added additional debugging.  Added DEBUG5 message to show what pids are
selected from PostgreSQL.  Updated debugging at the end of the to show
the column number of the data being returned.  In doing so noticed the
full command line arguments were omitted.

16 years agoAdding PORTING notes.
Mark Wong [Sat, 11 Oct 2008 00:54:50 +0000 (17:54 -0700)]
Adding PORTING notes.

17 years agoMake the pg_proctab stored function match the local use of the funtions. May
Mark Wong [Thu, 11 Sep 2008 03:40:58 +0000 (20:40 -0700)]
Make the pg_proctab stored function match the local use of the funtions.  May
have to generalize for use when support for other platforms are added.

17 years agoTurned skip_token() into a macro and hopefully simplified its use.
Mark Wong [Thu, 11 Sep 2008 03:39:18 +0000 (20:39 -0700)]
Turned skip_token() into a macro and hopefully simplified its use.

17 years agoRestructured all the code to hopefully make adding platform specific code
Mark Wong [Thu, 11 Sep 2008 03:23:42 +0000 (20:23 -0700)]
Restructured all the code to hopefully make adding platform specific code
easier.

17 years agoMoved all common definitions into a common header files, pg_common.h.
Mark Wong [Thu, 11 Sep 2008 03:22:24 +0000 (20:22 -0700)]
Moved all common definitions into a common header files, pg_common.h.

17 years agoInclude the correct header file from Linux for PROC_SUPER_MAGIC.
Mark Wong [Thu, 11 Sep 2008 03:20:28 +0000 (20:20 -0700)]
Include the correct header file from Linux for PROC_SUPER_MAGIC.

17 years agoFix commment formatting.
Mark Wong [Thu, 11 Sep 2008 03:17:25 +0000 (20:17 -0700)]
Fix commment formatting.

17 years agoReturning proper values for utime and stime.
Mark Wong [Wed, 27 Aug 2008 03:38:18 +0000 (20:38 -0700)]
Returning proper values for utime and stime.

17 years agoAdded the uid and the username of the pid's owner to the data returned by the
Mark Wong [Wed, 27 Aug 2008 03:37:25 +0000 (20:37 -0700)]
Added the uid and the username of the pid's owner to the data returned by the
stored function.

17 years agoAdded a column returning the full command line for each pid.
Mark Wong [Tue, 26 Aug 2008 05:31:24 +0000 (22:31 -0700)]
Added a column returning the full command line for each pid.

17 years agoClarify elog() messages when specific /proc entries are not found.
Mark Wong [Tue, 26 Aug 2008 05:27:07 +0000 (22:27 -0700)]
Clarify elog() messages when specific /proc entries are not found.

17 years agoContain Linux specific code within #ifdef __linux__.
Mark Wong [Tue, 26 Aug 2008 05:25:59 +0000 (22:25 -0700)]
Contain Linux specific code within #ifdef __linux__.

17 years agoStop changing the working directory because it seems to confuse PostgreSQL.
Mark Wong [Tue, 26 Aug 2008 05:25:20 +0000 (22:25 -0700)]
Stop changing the working directory because it seems to confuse PostgreSQL.

17 years agoAdded stored function to get memory usage statistics.
Mark Wong [Mon, 25 Aug 2008 06:02:19 +0000 (23:02 -0700)]
Added stored function to get memory usage statistics.

17 years agoAdded .hgignore file to ignore generated *.so and *.sql files.
Mark Wong [Sun, 24 Aug 2008 03:50:51 +0000 (20:50 -0700)]
Added .hgignore file to ignore generated *.so and *.sql files.

17 years agoMerged branches.
Mark Wong [Sat, 23 Aug 2008 05:50:43 +0000 (22:50 -0700)]
Merged branches.

17 years agoAdded C stored function to get processor utilization of the system.
Mark Wong [Sat, 23 Aug 2008 05:49:01 +0000 (22:49 -0700)]
Added C stored function to get processor utilization of the system.

17 years agoAdded a C stored function to get the system load average.
Mark Wong [Sat, 23 Aug 2008 05:47:54 +0000 (22:47 -0700)]
Added a C stored function to get the system load average.

17 years agoGrouped together Linux specific code within __linux__ #ifdef's.
Mark Wong [Sat, 23 Aug 2008 05:21:07 +0000 (22:21 -0700)]
Grouped together Linux specific code within __linux__ #ifdef's.

17 years agoStop parsing entries that are marked obsolete in the linux kernel
Mark Wong [Tue, 19 Aug 2008 00:36:22 +0000 (17:36 -0700)]
Stop parsing entries that are marked obsolete in the linux kernel
documentation.

17 years agoFixed a bug where the pointer used for parsing /proc/PID/stat skipped entries
Mark Wong [Tue, 19 Aug 2008 00:33:03 +0000 (17:33 -0700)]
Fixed a bug where the pointer used for parsing /proc/PID/stat skipped entries
when they were 1 digit, or parsed anything more than 1 digit incorrectly by
skipping the first digit.

17 years agoDifferent versions of linux have different number of entries in /proc/PID/stat.
Mark Wong [Tue, 19 Aug 2008 00:31:39 +0000 (17:31 -0700)]
Different versions of linux have different number of entries in /proc/PID/stat.
Fix a bug when delayacct_blkio_ticks is the last item causing it to be parsed
incorrectly.

17 years agoAdded additional DEBUG5 messages for further debugging.
Mark Wong [Tue, 19 Aug 2008 00:20:12 +0000 (17:20 -0700)]
Added additional DEBUG5 messages for further debugging.

17 years agoUse MemoryContextAlloc() instead of palloc(). The former allocates
Mark Wong [Sun, 17 Aug 2008 06:33:25 +0000 (23:33 -0700)]
Use MemoryContextAlloc() instead of palloc().  The former allocates
memory that is persistent between calls while the latter doesn't.

17 years agoAdded DEBUG5 messages to help debug memory problems.
Mark Wong [Sun, 17 Aug 2008 06:29:33 +0000 (23:29 -0700)]
Added DEBUG5 messages to help debug memory problems.

17 years agoRemoved reading wchan from the process table. The address of the system call
Mark Wong [Wed, 21 May 2008 06:24:33 +0000 (23:24 -0700)]
Removed reading wchan from the process table.  The address of the system call
is probably not that important.

17 years agoChanged the C stored function to return data for all procpid's in the
Mark Wong [Wed, 21 May 2008 03:35:24 +0000 (20:35 -0700)]
Changed the C stored function to return data for all procpid's in the
pg_stat_activity table.  Now you can join with other tables.  For example:

SELECT *
FROM pg_stat_activity, pg_proctab()
WHERE procpid = pid;

17 years agoJust a whitespace formatting change.
Mark Wong [Wed, 21 May 2008 03:33:16 +0000 (20:33 -0700)]
Just a whitespace formatting change.

17 years agoRemoved even more debug messages.
Mark Wong [Sat, 17 May 2008 04:48:18 +0000 (21:48 -0700)]
Removed even more debug messages.

17 years agoRemoved more debug messages committed by accident.
Mark Wong [Sat, 17 May 2008 04:40:13 +0000 (21:40 -0700)]
Removed more debug messages committed by accident.

17 years agoRemoved debug message committed by accident.
Mark Wong [Sat, 17 May 2008 04:39:15 +0000 (21:39 -0700)]
Removed debug message committed by accident.

17 years agoAdded a README.
Mark Wong [Fri, 16 May 2008 01:21:18 +0000 (18:21 -0700)]
Added a README.

17 years agoUse an INOUT parameter instead of an IN and OUT parameter for the pid.
Mark Wong [Wed, 14 May 2008 14:24:30 +0000 (07:24 -0700)]
Use an INOUT parameter instead of an IN and OUT parameter for the pid.

17 years agoRemoved debug elog() message.
Mark Wong [Wed, 14 May 2008 07:08:31 +0000 (00:08 -0700)]
Removed debug elog() message.

17 years agoFirst pass at creating a C stored function to access the process table in
Mark Wong [Wed, 14 May 2008 04:13:26 +0000 (21:13 -0700)]
First pass at creating a C stored function to access the process table in
Linux.