rpms/procps/devel procps-3.2.7-slabtop-once.patch, NONE, 1.1 procps-3.2.7-vmstat-timestamp-manpage.patch, NONE, 1.1 procps-3.2.7-vmstat-timestamp.patch, NONE, 1.1 procps.spec, 1.75, 1.76
Daniel Novotny
dnovotny at fedoraproject.org
Tue Feb 3 12:06:52 UTC 2009
- Previous message: rpms/gupnp-av/devel .cvsignore, 1.3, 1.4 gupnp-av.spec, 1.6, 1.7 sources, 1.3, 1.4
- Next message: rpms/gupnp-av/F-10 gupnp-av.spec,1.4,1.5 sources,1.3,1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: dnovotny
Update of /cvs/extras/rpms/procps/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv20701
Modified Files:
procps.spec
Added Files:
procps-3.2.7-slabtop-once.patch
procps-3.2.7-vmstat-timestamp-manpage.patch
procps-3.2.7-vmstat-timestamp.patch
Log Message:
fix #475963 and #476134
procps-3.2.7-slabtop-once.patch:
--- NEW FILE procps-3.2.7-slabtop-once.patch ---
diff -up procps-3.2.7/slabtop.c.once procps-3.2.7/slabtop.c
--- procps-3.2.7/slabtop.c.once 2008-12-11 13:24:52.000000000 +0100
+++ procps-3.2.7/slabtop.c 2008-12-11 13:33:12.000000000 +0100
@@ -268,9 +268,24 @@ static void parse_input(char c)
}
}
+/*printw or printf depending on the context*/
+static void printwf(int once, const char *s,...)
+{
+va_list va;
+
+va_start(va,s);
+if(once)
+ vprintf(s,va);
+else
+ vwprintw(stdscr, s, va);
+va_end(va);
+}
+
+
int main(int argc, char *argv[])
{
int o;
+ int once = 0;
unsigned short old_rows;
struct slab_info *slab_list = NULL;
@@ -307,6 +322,7 @@ int main(int argc, char *argv[])
break;
case 'o':
delay = 0;
+ once = 1;
break;
case 'V':
display_version();
@@ -322,12 +338,18 @@ int main(int argc, char *argv[])
if (tcgetattr(0, &saved_tty) == -1)
perror("tcgetattr");
- initscr();
- term_size(0);
- old_rows = rows;
- resizeterm(rows, cols);
- signal(SIGWINCH, term_size);
- signal(SIGINT, sigint_handler);
+ if(!once) {
+ initscr();
+ term_size(0);
+ old_rows = rows;
+ resizeterm(rows, cols);
+ signal(SIGWINCH, term_size);
+ signal(SIGINT, sigint_handler);
+ } else {
+ old_rows = rows;
+ rows = 80;
+ cols = 24;
+ }
do {
struct slab_info *curr;
@@ -341,12 +363,12 @@ int main(int argc, char *argv[])
break;
if (old_rows != rows) {
- resizeterm(rows, cols);
+ if(!once) resizeterm(rows, cols);
old_rows = rows;
}
move(0,0);
- printw( " Active / Total Objects (%% used) : %d / %d (%.1f%%)\n"
+ printwf(once, " Active / Total Objects (%% used) : %d / %d (%.1f%%)\n"
" Active / Total Slabs (%% used) : %d / %d (%.1f%%)\n"
" Active / Total Caches (%% used) : %d / %d (%.1f%%)\n"
" Active / Total Size (%% used) : %.2fK / %.2fK (%.1f%%)\n"
@@ -360,15 +382,15 @@ int main(int argc, char *argv[])
slab_list = slabsort(slab_list);
- attron(A_REVERSE);
- printw( "%6s %6s %4s %8s %6s %8s %10s %-23s\n",
+ if(!once) attron(A_REVERSE);
+ printwf(once, "%6s %6s %4s %8s %6s %8s %10s %-23s\n",
"OBJS", "ACTIVE", "USE", "OBJ SIZE", "SLABS",
"OBJ/SLAB", "CACHE SIZE", "NAME");
- attroff(A_REVERSE);
+ if(!once) attroff(A_REVERSE);
curr = slab_list;
for (i = 0; i < rows - 8 && curr->next; i++) {
- printw("%6u %6u %3u%% %7.2fK %6u %8u %9uK %-23s\n",
+ printwf(once, "%6u %6u %3u%% %7.2fK %6u %8u %9uK %-23s\n",
curr->nr_objs, curr->nr_active_objs, curr->use,
curr->obj_size / 1024.0, curr->nr_slabs,
curr->objs_per_slab, (unsigned)(curr->cache_size / 1024),
@@ -376,7 +398,7 @@ int main(int argc, char *argv[])
curr = curr->next;
}
- refresh();
+ if(!once) refresh();
put_slabinfo(slab_list);
FD_ZERO(&readfds);
@@ -392,6 +414,6 @@ int main(int argc, char *argv[])
tcsetattr(0, TCSAFLUSH, &saved_tty);
free_slabinfo(slab_list);
- endwin();
+ if(!once) endwin();
return 0;
}
procps-3.2.7-vmstat-timestamp-manpage.patch:
--- NEW FILE procps-3.2.7-vmstat-timestamp-manpage.patch ---
diff -up procps-3.2.7/vmstat.8.timestamp procps-3.2.7/vmstat.8
--- procps-3.2.7/vmstat.8.timestamp 2009-02-03 12:32:27.000000000 +0100
+++ procps-3.2.7/vmstat.8 2009-02-03 12:34:37.000000000 +0100
@@ -8,6 +8,7 @@ vmstat \- Report virtual memory statisti
.B vmstat
.RB [ "\-a" ]
.RB [ "\-n" ]
+.RB [ "\-t" ]
.RI [ delay " [ " count ]]
.br
.B vmstat
@@ -43,7 +44,9 @@ equivalent to the total number of tasks
is represented by one or more tasks, depending on thread usage.
This display does not repeat.
.PP
-The \fB-m\fP displays slabinfo.
+The \fB-t\fP switch adds timestamp to the output.
+.PP
+The \fB-m\fP switch displays slabinfo.
.PP
The \fB-n\fP switch causes the header to be displayed only once rather than periodically.
.PP
procps-3.2.7-vmstat-timestamp.patch:
--- NEW FILE procps-3.2.7-vmstat-timestamp.patch ---
--- procps-3.2.7/vmstat.c 2008-12-11 22:11:30.042532106 -0500
+++ procps-3.2.7/vmstat.c.timestamp 2008-12-11 22:08:11.553529883 -0500
@@ -25,6 +25,7 @@
#include <sys/ioctl.h>
#include <sys/dir.h>
#include <dirent.h>
+#include <time.h>
#include "proc/sysinfo.h"
#include "proc/version.h"
@@ -56,6 +57,7 @@
static unsigned int height; // window height
static unsigned int moreheaders=TRUE;
+static unsigned int showtimestamp=FALSE;
/////////////////////////////////////////////////////////////////////////
@@ -71,6 +73,7 @@
fprintf(stderr," -p prints disk partition statistics\n");
fprintf(stderr," -s prints vm table\n");
fprintf(stderr," -m prints slabinfo\n");
+ fprintf(stderr," -t add timestamp to output\n");
fprintf(stderr," -S unit size\n");
fprintf(stderr," delay is the delay between updates in seconds. \n");
fprintf(stderr," unit size k:1000 K:1024 m:1000000 M:1048576 (default is K)\n");
@@ -150,7 +153,11 @@
////////////////////////////////////////////////////////////////////////////
static void new_header(void){
- printf("procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----\n");
+ if(!showtimestamp){
+ printf("procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----\n");
+ } else {
+ printf("procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------ ---timestamp---\n");
+ }
printf(
"%2s %2s %6s %6s %6s %6s %4s %4s %5s %5s %4s %4s %2s %2s %2s %2s %2s\n",
"r","b",
@@ -173,7 +180,7 @@
////////////////////////////////////////////////////////////////////////////
static void new_format(void) {
- const char format[]="%2u %2u %6lu %6lu %6lu %6lu %4u %4u %5u %5u %4u %4u %2u %2u %2u %2u %2u\n";
+ const char format[]="%2u %2u %6lu %6lu %6lu %6lu %4u %4u %5u %5u %4u %4u %2u %2u %2u %2u %2u\t%s\n";
unsigned int tog=0; /* toggle switch for cleaner code */
unsigned int i;
unsigned int hz = Hertz;
@@ -185,6 +192,10 @@
unsigned int sleep_half;
unsigned long kb_per_page = sysconf(_SC_PAGESIZE) / 1024ul;
int debt = 0; // handle idle ticks running backwards
+ struct tm *tm_ptr;
+ time_t the_time;
+ char timebuf[32];
+ timebuf[0] = '\0';
sleep_half=(sleep_time/2);
new_header();
@@ -196,6 +207,13 @@
&running,&blocked,
&dummy_1, &dummy_2);
+ if (showtimestamp)
+ {
+ (void) time( &the_time );
+ tm_ptr = localtime( &the_time );
+ strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S %Z", tm_ptr);
+ }
+
duse= *cpu_use + *cpu_nic;
dsys= *cpu_sys + *cpu_xxx + *cpu_yyy;
didl= *cpu_idl;
@@ -218,7 +236,8 @@
(unsigned)( (100*dsys + divo2) / Div ),
(unsigned)( (100*didl + divo2) / Div ),
(unsigned)( (100*diow + divo2) / Div ),
- (unsigned)( (100*dstl + divo2) / Div )
+ (unsigned)( (100*dstl + divo2) / Div ),
+ timebuf
);
for(i=1;i<num_updates;i++) { /* \\\\\\\\\\\\\\\\\\\\ main loop ////////////////// */
@@ -234,6 +253,13 @@
&running,&blocked,
&dummy_1,&dummy_2);
+ if (showtimestamp)
+ {
+ (void) time( &the_time );
+ tm_ptr = localtime( &the_time );
+ strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S %Z", tm_ptr);
+ }
+
duse= cpu_use[tog]-cpu_use[!tog] + cpu_nic[tog]-cpu_nic[!tog];
dsys= cpu_sys[tog]-cpu_sys[!tog] + cpu_xxx[tog]-cpu_xxx[!tog] + cpu_yyy[tog]-cpu_yyy[!tog];
didl= cpu_idl[tog]-cpu_idl[!tog];
@@ -267,7 +293,8 @@
(unsigned)( (100*dsys+divo2)/Div ), /*sy*/
(unsigned)( (100*didl+divo2)/Div ), /*id*/
(unsigned)( (100*diow+divo2)/Div ), //wa
- (unsigned)( (100*dstl+divo2)/Div ) //st
+ (unsigned)( (100*dstl+divo2)/Div ), //st
+ timebuf /* timestamp */
);
}
}
@@ -641,6 +668,9 @@
case 's':
statMode |= VMSUMSTAT;
break;
+ case 't':
+ showtimestamp=TRUE;
+ break;
default:
/* no other aguments defined yet. */
usage();
Index: procps.spec
===================================================================
RCS file: /cvs/extras/rpms/procps/devel/procps.spec,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -r1.75 -r1.76
--- procps.spec 7 Jan 2009 19:21:41 -0000 1.75
+++ procps.spec 3 Feb 2009 12:06:51 -0000 1.76
@@ -1,7 +1,7 @@
Summary: System and process monitoring utilities
Name: procps
Version: 3.2.7
-Release: 23%{?dist}
+Release: 24%{?dist}
License: GPLv2+ and LGPLv2+
Group: Applications/System
URL: http://procps.sourceforge.net
@@ -77,6 +77,14 @@
Patch36: procps-3.2.7-vmstat-partstats-long.patch
# Fix vmstat header to be 80 chars not 81
Patch37: procps-3.2.7-vmstat-header.patch
+# rhel bug #475963: slabtop -o should display the info once
+Patch38: procps-3.2.7-slabtop-once.patch
+#476134 - added timestamp to vmstat with new option -t
+Patch39: procps-3.2.7-vmstat-timestamp.patch
+#manual page updated to document the -t functionality
+Patch40: procps-3.2.7-vmstat-timestamp-manpage.patch
+
+
BuildRequires: ncurses-devel
@@ -139,6 +147,9 @@
%patch35 -p1
%patch36 -p1
%patch37 -p1
+%patch38 -p1
+%patch39 -p1
+%patch40 -p1
cp %SOURCE1 .
@@ -176,6 +187,10 @@
%attr(0644,root,root) %{_mandir}/man5/*
%changelog
+*Tue Feb 03 2009 Daniel Novotny <dnovotny at redhat.com> 3.2.7-24
+- slabtop -o should display the info once and then exit (RHEL bug #475963)
+- added timestamp to vmstat with new option -t (#476134)
+
* Wed Jan 07 2009 Adam Jackson <ajax at redhat.com> 3.2.7-23
- procps-3.2.7-vmstat-header.patch: Fix vmstat header to fit on a single line.
- Previous message: rpms/gupnp-av/devel .cvsignore, 1.3, 1.4 gupnp-av.spec, 1.6, 1.7 sources, 1.3, 1.4
- Next message: rpms/gupnp-av/F-10 gupnp-av.spec,1.4,1.5 sources,1.3,1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the scm-commits
mailing list