r13840 - in /branches/upstream/libproc-processtable-perl/current: Changes META.yml ProcessTable.pm ProcessTable.xs hints/solaris.pl os/Linux.c os/Linux.h os/darwin.c t/process.t

gwolf at users.alioth.debian.org gwolf at users.alioth.debian.org
Tue Jan 29 18:10:12 UTC 2008


Author: gwolf
Date: Tue Jan 29 18:10:11 2008
New Revision: 13840

URL: http://svn.debian.org/wsvn/?sc=1&rev=13840
Log:
[svn-upgrade] Integrating new upstream version, libproc-processtable-perl (0.42)

Modified:
    branches/upstream/libproc-processtable-perl/current/Changes
    branches/upstream/libproc-processtable-perl/current/META.yml
    branches/upstream/libproc-processtable-perl/current/ProcessTable.pm
    branches/upstream/libproc-processtable-perl/current/ProcessTable.xs
    branches/upstream/libproc-processtable-perl/current/hints/solaris.pl
    branches/upstream/libproc-processtable-perl/current/os/Linux.c
    branches/upstream/libproc-processtable-perl/current/os/Linux.h
    branches/upstream/libproc-processtable-perl/current/os/darwin.c
    branches/upstream/libproc-processtable-perl/current/t/process.t

Modified: branches/upstream/libproc-processtable-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-processtable-perl/current/Changes?rev=13840&op=diff
==============================================================================
--- branches/upstream/libproc-processtable-perl/current/Changes (original)
+++ branches/upstream/libproc-processtable-perl/current/Changes Tue Jan 29 18:10:11 2008
@@ -261,3 +261,10 @@
 	#14836). Fixed empty pctmem bug on linux due to change in
 	format of /proc/meminfo (hopefully this format is stable
 	now??). 
+
+0.42	Fri Jan 25 22:29:00 MST 2008
+	-Patch to fix PROC_FS define in Solaris 5.10 from jlv
+	<jloverso at mathworks.com>; patch to replace kinfo array and use
+	KINFO structure on darwin. Patch from Steve Linn
+	<steve at rhythm.com> for x86_64 linux. Shortened test code so it
+	only shows info for current process.

Modified: branches/upstream/libproc-processtable-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-processtable-perl/current/META.yml?rev=13840&op=diff
==============================================================================
--- branches/upstream/libproc-processtable-perl/current/META.yml (original)
+++ branches/upstream/libproc-processtable-perl/current/META.yml Tue Jan 29 18:10:11 2008
@@ -1,7 +1,7 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         Proc-ProcessTable
-version:      0.41
+version:      0.42
 version_from: ProcessTable.pm
 installdirs:  site
 requires:
@@ -9,4 +9,4 @@
     Storable:                      0
 
 distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.30
+generated_by: ExtUtils::MakeMaker version 6.30_01

Modified: branches/upstream/libproc-processtable-perl/current/ProcessTable.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-processtable-perl/current/ProcessTable.pm?rev=13840&op=diff
==============================================================================
--- branches/upstream/libproc-processtable-perl/current/ProcessTable.pm (original)
+++ branches/upstream/libproc-processtable-perl/current/ProcessTable.pm Tue Jan 29 18:10:11 2008
@@ -16,7 +16,7 @@
 @EXPORT = qw(
 	
 );
-$VERSION = '0.41';
+$VERSION = '0.42';
 
 sub AUTOLOAD {
     # This AUTOLOAD is used to 'autoload' constants from the constant()

Modified: branches/upstream/libproc-processtable-perl/current/ProcessTable.xs
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-processtable-perl/current/ProcessTable.xs?rev=13840&op=diff
==============================================================================
--- branches/upstream/libproc-processtable-perl/current/ProcessTable.xs (original)
+++ branches/upstream/libproc-processtable-perl/current/ProcessTable.xs Tue Jan 29 18:10:11 2008
@@ -118,6 +118,8 @@
 /*   U 	  ignore this unsigned                                        */
 /*   u 	  unsigned                                                    */
 /*   V    perl scalar value                                           */
+/*   P    ignore this string                                          */
+/*   p    unsigned long                                               */
 /* fields is an array of pointers to field names                      */
 /* following that is a var args list of field values                  */
 /**********************************************************************/
@@ -129,6 +131,7 @@
   int i_val;
   unsigned u_val;
   long l_val;
+  unsigned long p_val;
   long long ll_val;
 
   HV* myhash;
@@ -186,9 +189,17 @@
       case 'l':  /* long */
 	l_val = va_arg(args, long);
 	hv_store(myhash, key, strlen(key), newSVnv(l_val), 0);
-
 	/* Look up and store the tty if this is ttynum */
 	if( !strcmp(key, "ttynum") ) store_ttydev( myhash, l_val );
+	break;
+
+      case 'P':  /* ignore; creates an undef value for this key in the hash */
+	va_arg(args, unsigned long);
+	hv_store(myhash, key, strlen(key), &PL_sv_undef, 0);
+	break;
+      case 'p':  /* unsigned long */
+	p_val = va_arg(args, unsigned long);
+	hv_store(myhash, key, strlen(key), newSVnv(p_val), 0);
 	break;
 
       case 'J':  /* ignore; creates an undef value for this key in the hash */

Modified: branches/upstream/libproc-processtable-perl/current/hints/solaris.pl
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-processtable-perl/current/hints/solaris.pl?rev=13840&op=diff
==============================================================================
--- branches/upstream/libproc-processtable-perl/current/hints/solaris.pl (original)
+++ branches/upstream/libproc-processtable-perl/current/hints/solaris.pl Tue Jan 29 18:10:11 2008
@@ -14,7 +14,7 @@
 # If this OS version supports the new /proc filesystem, use it; 
 # otherwise default to ioctl-proc
 `uname -r` =~ /^(\d+\.\d+)/;
-if( $1 > 5.5 ){
+if( $1 !~ /^5.[012345]$/ ){
     $self->{DEFINE} = $self->{DEFINE} . " -DPROC_FS";
 }
 

Modified: branches/upstream/libproc-processtable-perl/current/os/Linux.c
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-processtable-perl/current/os/Linux.c?rev=13840&op=diff
==============================================================================
--- branches/upstream/libproc-processtable-perl/current/os/Linux.c (original)
+++ branches/upstream/libproc-processtable-perl/current/os/Linux.c Tue Jan 29 18:10:11 2008
@@ -18,7 +18,7 @@
 		return NULL;
 
 	result = fscanf(fp, 
-			"%d %s %c %d %d %d %d %d %u %u %u %u %u %Ld %Ld %Ld %Ld %d %d %u %u %lu %u %u %u %u %u %u %u %u %d %d %d %d %u",
+			"%d %s %c %d %d %d %d %d %u %u %u %u %u %Ld %Ld %Ld %Ld %d %d %u %u %lu %lu %lu %u %u %u %u %u %u %d %d %d %d %u",
 			&prs->pid, 
 			prs->comm,		/* char comm[FILENAME_MAX]; */
 			&prs->state, 

Modified: branches/upstream/libproc-processtable-perl/current/os/Linux.h
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-processtable-perl/current/os/Linux.h?rev=13840&op=diff
==============================================================================
--- branches/upstream/libproc-processtable-perl/current/os/Linux.h (original)
+++ branches/upstream/libproc-processtable-perl/current/os/Linux.h Tue Jan 29 18:10:11 2008
@@ -58,8 +58,8 @@
   unsigned timeout;
   unsigned itrealvalue;
   unsigned long  starttime;
-  unsigned vsize;
-  unsigned rss;
+  unsigned long vsize;
+  unsigned long rss;
   unsigned rlim;
   unsigned startcode;
   unsigned endcode;
@@ -75,7 +75,7 @@
 
 /* We need to pass in a cap for ignore, lower for store on object */
 /* We can just lc these! */
-static char Defaultformat[] = "IIIIIIIIIIIIIJJJJJJUIISLSSSSSIIIIIIS";
+static char Defaultformat[] = "IIIIIIIIIIIIIJJJJJJPPISLSSSSSIIIIIIS";
 
 /* Mapping of field to type */
 static char* Fields[] = {

Modified: branches/upstream/libproc-processtable-perl/current/os/darwin.c
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-processtable-perl/current/os/darwin.c?rev=13840&op=diff
==============================================================================
--- branches/upstream/libproc-processtable-perl/current/os/darwin.c (original)
+++ branches/upstream/libproc-processtable-perl/current/os/darwin.c Tue Jan 29 18:10:11 2008
@@ -85,7 +85,6 @@
 
 #define FREE_BUFFERS \
 	{	if (kprocbuf != NULL) free (kprocbuf); \
-		if (kinfo != NULL) free (kinfo); \
 	}
 
 void OS_get_table(void) {
@@ -94,7 +93,6 @@
 	char *command_name;
 	int cmdlen;
 	int i;
-	KINFO *kinfo = NULL;
 	struct kinfo_proc *kp;
 	struct kinfo_proc *kprocbuf = NULL;
 	int local_error=0;
@@ -136,14 +134,11 @@
 		may have changed.  */
 	nentries = bufSize/ sizeof(struct kinfo_proc);
 
-	if ((kinfo = malloc(nentries * sizeof(KINFO))) == NULL)
-		DIE_HORRIBLY ("Memory allocation failure")
-	memset(kinfo, 0, (nentries * sizeof(*kinfo)));
-
 	/* the loop was stolen from ps - but it backs through the data.
 	 * We're going through forward, which means we need to play
 	 * slightly different games.
 	 */
+
 #if 1
 	kp += nentries - 1;
 	for (i = 1; i <= nentries; i++, --kp) {
@@ -152,14 +147,15 @@
 #endif
 		struct extern_proc *p;
 		struct eproc *e;
-		KINFO *ki;
+		KINFO kinfo;
+		KINFO *ki = &kinfo;
+		memset(ki, 0, sizeof(*ki));
 #ifdef TESTING
 		char *ttname = NULL;
 #endif /* def TESTING */
 
 		time_value_t total_time, system_time, user_time;
 
-		ki = &kinfo[i];	
 		ki->ki_p = kp;
 
 		get_task_info(ki);

Modified: branches/upstream/libproc-processtable-perl/current/t/process.t
URL: http://svn.debian.org/wsvn/branches/upstream/libproc-processtable-perl/current/t/process.t?rev=13840&op=diff
==============================================================================
--- branches/upstream/libproc-processtable-perl/current/t/process.t (original)
+++ branches/upstream/libproc-processtable-perl/current/t/process.t Tue Jan 29 18:10:11 2008
@@ -6,7 +6,7 @@
 BEGIN { plan tests => 3 }
 
 # check wether ProcProcessTable is there
-use Proc::ProcessTable; 
+use Proc::ProcessTable;
 
 # Test code
 
@@ -18,6 +18,7 @@
 # Is there a process called cron
 foreach $got ( @{$t->table} )
 {
+  next unless $got->pid == $$;
 #  print STDERR $got->pid, "  ", $got->fname, "\n";
   print STDERR "--------------------------------\n";
   foreach $field ($t->fields){




More information about the Pkg-perl-cvs-commits mailing list