From 23e753fd473081d2c559d6ef0161c839fcfbdcce Mon Sep 17 00:00:00 2001 From: Craig Small Date: Fri, 23 Dec 2011 00:44:23 +1100 Subject: [PATCH 1/2] Fixed pmap -x Kbytes column The Kbytes column when using the pmap -x flag would always be zero. This was because the diff variable was reset before it could be printed. pmap with no -x was not impacted by this bug or fix. --- pmap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmap.c b/pmap.c index c92737d8..6555b841 100644 --- a/pmap.c +++ b/pmap.c @@ -138,6 +138,7 @@ static int one_proc(proc_t *p){ unsigned long long total_rss = 0ull; unsigned long long total_private_dirty = 0ull; unsigned long long total_shared_dirty = 0ull; + unsigned KLONG diff=0; // Overkill, but who knows what is proper? The "w" prog // uses the tty width to determine this. @@ -167,7 +168,7 @@ static int one_proc(proc_t *p){ while(fgets(mapbuf,sizeof mapbuf,fp)){ char flags[32]; char *tmp; // to clean up unprintables - unsigned KLONG start, end, diff=0; + unsigned KLONG start, end; unsigned long long file_offset, inode; unsigned dev_major, dev_minor; unsigned long long smap_value; @@ -206,6 +207,7 @@ static int one_proc(proc_t *p){ ); /* reset some counters */ rss = shared_dirty = private_dirty = 0ull; + diff=0; continue; } /* Other keys */ From 2983b305235bb6ed5a22e0a397fce5078b2cb63c Mon Sep 17 00:00:00 2001 From: Craig Small Date: Fri, 23 Dec 2011 09:18:43 +1100 Subject: [PATCH 2/2] Renaming libprocfs to libprocps The library used to be called libprocps but it was renamed to make sure there was only one. However the formatting of the library SONAME has changed so there cannot be any confusion. libprocps makes it clear that its a library from this project and not a set of functions directly on the filesystem. --- .gitignore | 4 ++-- Makefile.am | 2 +- configure.ac | 2 +- proc/Makefile.am | 26 +++++++++++------------ proc/{libprocfs.pc.in => libprocps.pc.in} | 4 ++-- proc/{libprocfs.sym => libprocps.sym} | 2 +- ps/Makefile.am | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) rename proc/{libprocfs.pc.in => libprocps.pc.in} (82%) rename proc/{libprocfs.sym => libprocps.sym} (98%) diff --git a/.gitignore b/.gitignore index 2e20e98e..43387054 100644 --- a/.gitignore +++ b/.gitignore @@ -28,8 +28,8 @@ pkill pmap procps-ng-*.tar.gz proc/.depend -proc/libprocfs.la -proc/libprocfs.pc +proc/libprocps.la +proc/libprocps.pc proc/Makefile proc/Makefile.in ps/Makefile diff --git a/Makefile.am b/Makefile.am index 3c5be856..e246d026 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,7 +4,7 @@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = proc ps testsuite AM_CFLAGS = -Iproc -AM_LDFLAGS = ./proc/libprocfs.la +AM_LDFLAGS = ./proc/libprocps.la sbin_PROGRAMS = \ sysctl diff --git a/configure.ac b/configure.ac index 63a3c37a..85afd0e1 100644 --- a/configure.ac +++ b/configure.ac @@ -169,7 +169,7 @@ AC_SUBST(DEJAGNU) AC_CONFIG_FILES([ Makefile proc/Makefile -proc/libprocfs.pc +proc/libprocps.pc ps/Makefile testsuite/Makefile ]) diff --git a/proc/Makefile.am b/proc/Makefile.am index 633f8b93..f76d96cd 100644 --- a/proc/Makefile.am +++ b/proc/Makefile.am @@ -1,27 +1,27 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ AM_CPPFLAGS = -include $(top_builddir)/config.h -LIBPROCFS_CURRENT=0 -LIBPROCFS_REVISION=0 -LIBPROCFS_AGE=0 +LIBprocps_CURRENT=0 +LIBprocps_REVISION=0 +LIBprocps_AGE=0 -lib_LTLIBRARIES = libprocfs.la +lib_LTLIBRARIES = libprocps.la -libprocfs_ladir = $(ladir) -libprocfs_la_LIBADD = $(LIB_KPARTS) -libprocfs_la_LDFLAGS = \ +libprocps_ladir = $(ladir) +libprocps_la_LIBADD = $(LIB_KPARTS) +libprocps_la_LDFLAGS = \ $(AM_LDFLAGS) \ $(all_libraries) \ - -version-info $(LIBPROCFS_CURRENT):$(LIBPROCFS_REVISION):$(LIBPROCFS_AGE) \ + -version-info $(LIBprocps_CURRENT):$(LIBprocps_REVISION):$(LIBprocps_AGE) \ -no-undefined \ - -Wl,--version-script=$(top_srcdir)/proc/libprocfs.sym + -Wl,--version-script=$(top_srcdir)/proc/libprocps.sym EXTRA_DIST = library.map pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libprocfs.pc +pkgconfig_DATA = libprocps.pc -libprocfs_la_SOURCES = \ +libprocps_la_SOURCES = \ alloc.c \ alloc.h \ devname.c \ @@ -46,8 +46,8 @@ libprocfs_la_SOURCES = \ whattime.c \ whattime.h -libprocfs_la_includedir = $(includedir)/proc/ -libprocfs_la_include_HEADERS = \ +libprocps_la_includedir = $(includedir)/proc/ +libprocps_la_include_HEADERS = \ alloc.h \ devname.h \ escape.h \ diff --git a/proc/libprocfs.pc.in b/proc/libprocps.pc.in similarity index 82% rename from proc/libprocfs.pc.in rename to proc/libprocps.pc.in index 0167c66a..1f9c1339 100644 --- a/proc/libprocfs.pc.in +++ b/proc/libprocps.pc.in @@ -3,9 +3,9 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ -Name: libprocfs +Name: libprocps Description: Library to control and query process state Version: @VERSION@ -Libs: -L${libdir} -lprocfs +Libs: -L${libdir} -lprocps Libs.private: Cflags: -I${includedir} diff --git a/proc/libprocfs.sym b/proc/libprocps.sym similarity index 98% rename from proc/libprocfs.sym rename to proc/libprocps.sym index d8bf6b73..3e4f9a22 100644 --- a/proc/libprocfs.sym +++ b/proc/libprocps.sym @@ -1,4 +1,4 @@ -LIBPROCFS_0 { +LIBPROCPS_0 { global: Hertz; __cyg_profile_func_enter; diff --git a/ps/Makefile.am b/ps/Makefile.am index 84df5c23..b3bd9874 100644 --- a/ps/Makefile.am +++ b/ps/Makefile.am @@ -1,7 +1,7 @@ AM_CPPFLAGS = -include $(top_builddir)/config.h AM_CFLAGS = -I../proc -AM_LDFLAGS = ../proc/libprocfs.la +AM_LDFLAGS = ../proc/libprocps.la dist_man_MANS = ps.1