Hello community, here is the log from the commit of package procps for openSUSE:Factory checked in at 2013-06-05 13:34:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/procps (Old) and /work/SRC/openSUSE:Factory/.procps.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "procps" Changes: -------- --- /work/SRC/openSUSE:Factory/procps/procps.changes 2013-05-28 07:41:31.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.procps.new/procps.changes 2013-06-05 13:35:02.000000000 +0200 @@ -1,0 +2,43 @@ +Wed May 29 13:55:41 UTC 2013 - [email protected] + +- Update to procps-ng-3.3.8 + * top adds extensions for linux NUMA/Node capability + * top has reverted to former %CPU and %MEM precision + but also provides a '--enable-wide-percent' option + Debian #707648 + * eliminate the potential library segmentation fault + Debian #706259, RedHat #951391 + * top now accomodates a window manager like 'screen' + RedHat #962022 + * ps shows systemd unit and user unit for a process +- Update to procps-ng-3.3.7 + * top adds a powerful new filter feature wherein any + window can include or exlude selected fields which + contain specific values - Debian #682082 & #682083 + * top preserves user input for later recall and edit + * top provides true input editing vs. just backspace + * top user filtering with exclusion - Debian #682086 + * top field management resize errors no longer fatal + * top is more responsive to window resize (SIGWINCH) + * top will now preserve user's context when signaled +- Update to procps-ng-3.3.6 + * top adds a powerful new feature where the contents + of some file or output from a program, pipeline or + shell script can be viewed in its own scrollable & + searchable window while pausing the normal display + * top highlights matches with 'locate/next' commands + * top adds summary/task area memory scaling commands + * top adds a command to suppress insignificant zeros + * top adds a command line sort field override switch + * top provides a default PID for kill, nice commands + * top allows core dump generation, if a signal would + * pmap adds 2 new options based on smaps, -X and -XX + * Adjusted pmap pidlist storage Debian #688180 + * programs will permit core-dumps RedHat #87825, 512857 + * receiving a signal is not a crash RedHat #871824, 441656 + * ps: Fixed negative etime RedHat #871819, #433266 + * pkill -c option returns Debian #693783 + * pmap uses correct types for memory allocation Debian #688180 + * expose freeproc, adds function to API Debian #681653 + +------------------------------------------------------------------- Old: ---- procps-v3.3.3-accuracy.dif procps-v3.3.3-bnc634840.patch procps-v3.3.3-readeof.patch procps-v3.3.3-selinux.patch procps-v3.3.3-tinfo.dif procps-v3.3.4-bnc634071_procstat2.diff procps-v3.3.4-petabytes.patch procps-v3.3.4-top.1.diff procps-v3.3.4-watch.patch procps-v3.3.5.tar.bz2 New: ---- procps-ng-3.3.8-accuracy.dif procps-ng-3.3.8-bnc634071_procstat2.diff procps-ng-3.3.8-bnc634840.patch procps-ng-3.3.8-petabytes.patch procps-ng-3.3.8-readeof.patch procps-ng-3.3.8-selinux.patch procps-ng-3.3.8-tinfo.dif procps-ng-3.3.8-top.1.diff procps-ng-3.3.8-watch.patch procps-ng-3.3.8.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ procps.spec ++++++ --- /var/tmp/diff_new_pack.xi8FFB/_old 2013-06-05 13:35:03.000000000 +0200 +++ /var/tmp/diff_new_pack.xi8FFB/_new 2013-06-05 13:35:03.000000000 +0200 @@ -21,51 +21,56 @@ %define libname libprocps%{somajor} Name: procps +#Also: http://gitorious.org/procps/ Url: http://sf.net/projects/procps-ng/ BuildRequires: automake +%ifarch ia64 x86_64 ppc64 ppc %sparc +BuildRequires: libnuma-devel +%endif BuildRequires: libselinux-devel BuildRequires: libtool BuildRequires: ncurses-devel BuildRequires: pkg-config -PreReq: %fillup_prereq %insserv_prereq +%if 0%{?suse_version} > 1230 +BuildRequires: pkgconfig(systemd) +%endif +BuildRequires: xz +Version: 3.3.8 +Release: 0 Provides: ps = %version-%release Obsoletes: ps < %version-%release -Version: 3.3.5 -Release: 0 +Requires(post): %fillup_prereq +Requires(post): %insserv_prereq +Requires(postun): %insserv_prereq Summary: The ps utilities for /proc License: GPL-2.0+ and LGPL-2.1+ Group: System/Monitoring - -#Git-Clone: git://gitorious.org/procps/procps -Source: procps-v%version.tar.bz2 +Source: http://downloads.sourceforge.net/project/procps-ng/Production/procps-ng-3.3.8.tar.xz Source1: procps-pmap-legacy.tar.bz2 Source2: boot.sysctl Source3: systat.xinetd -Patch0: procps-v3.3.4-watch.patch +Patch0: procps-ng-3.3.8-watch.patch Patch1: procps-v3.3.3-ia64.diff Patch2: procps-v3.3.4-stealtime.patch Patch3: procps-v3.3.4-w-notruncate.diff Patch4: procps-v3.3.4-w-simply-work.diff -Patch5: procps-v3.3.4-top.1.diff +Patch5: procps-ng-3.3.8-top.1.diff Patch6: procps-v3.3.3-buffersize.diff -Patch7: procps-v3.3.3-readeof.patch +Patch7: procps-ng-3.3.8-readeof.patch Patch8: procps-v3.3.3-slab.patch -Patch9: procps-v3.3.3-selinux.patch -Patch10: procps-v3.3.3-accuracy.dif +Patch9: procps-ng-3.3.8-selinux.patch +Patch10: procps-ng-3.3.8-accuracy.dif Patch11: procps-v3.3.4-xen.dif Patch12: procps-v3.3.3-fdleak.dif Patch13: procps-v3.3.3-columns.dif Patch14: procps-v3.3.3-integer-overflow.patch -Patch15: procps-v3.3.4-bnc634071_procstat2.diff -Patch16: procps-v3.3.3-bnc634840.patch +Patch15: procps-ng-3.3.8-bnc634071_procstat2.diff +Patch16: procps-ng-3.3.8-bnc634840.patch Patch17: procps-v3.3.3-read-sysctls-also-from-boot-sysctl.conf-kernelversion.diff -Patch18: procps-v3.3.4-petabytes.patch +Patch18: procps-ng-3.3.8-petabytes.patch Patch19: procps-v3.3.4-large_pcpu.patch -Patch20: procps-v3.3.3-tinfo.dif +Patch20: procps-ng-3.3.8-tinfo.dif Patch21: procps-v3.3.3-pwdx.patch -Patch22: procps-v3.3.3-chroot.diff -# PATCH-FIX-UPSTREAM procps-v3.3.5-top-locale.patch -- bnc#794678 - top has a locale-dpendent config file -Patch23: procps-v3.3.5-top-locale.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -100,14 +105,15 @@ Summary: The props library License: LGPL-2.1+ Group: System/Libraries +Requires(post): /sbin/ldconfig +Requires(postun): /sbin/ldconfig %description -n %{libname} The props library can be used to read informations out from /proc the process information pseudo-file system, %prep -%setup -q -n %{name}-v%{version} -%__tar --strip-components=1 -xjf %{S:1} +%setup -q -n %{name}-ng-%{version} %patch0 %patch1 %patch2 @@ -130,13 +136,11 @@ %patch19 %patch20 %patch21 -%patch22 -%patch23 %build -sh po/update-potfiles test -s .tarball-version || echo %{version} > .tarball-version -./autogen.sh +#./autogen.sh +autoreconf export NCURSESW_CFLAGS="$(ncursesw5-config --cflags)" export NCURSESW_LIBS="$(ncursesw5-config --libs)" export LFS_CFLAGS="$(getconf LFS_CFLAGS)" @@ -151,7 +155,15 @@ --enable-skill \ --enable-oomem \ --enable-w-from \ + --enable-sigwinch \ + --enable-wide-percent \ + --enable-w-from \ --with-pic=yes \ +%if 0%{?suse_version} > 1230 + --with-systemd \ +%else + --without-systemd \ +%endif --with-gnu-ld make %{?_smp_mflags} @@ -279,7 +291,6 @@ %files -n %{libname} %defattr (-,root,root,755) -%{_libdir}/libprocps.so.1 -%{_libdir}/libprocps.so.1.0.0 +%{_libdir}/libprocps.so.%{somajor}* %changelog ++++++ procps-ng-3.3.8-accuracy.dif ++++++ --- ps/common.h +++ ps/common.h 2012-06-01 15:30:43.880009972 +0000 @@ -302,6 +302,7 @@ extern int running_only; extern int screen_cols; extern int screen_rows; extern time_t seconds_since_boot; +extern unsigned long long jiffies_since_boot; extern selection_node *selection_list; extern unsigned simple_select; extern sort_node *sort_list; --- ps/global.c +++ ps/global.c 2012-06-01 15:32:10.488010283 +0000 @@ -79,6 +79,7 @@ int prefer_bsd_defaults = -1 int screen_cols = -1; int screen_rows = -1; time_t seconds_since_boot = -1; +unsigned long long jiffies_since_boot = -1; selection_node *selection_list = (selection_node *)0xdeadbeef; unsigned simple_select = 0xffffffff; sort_node *sort_list = (sort_node *)0xdeadbeef; /* ready-to-use sort list */ @@ -369,6 +370,7 @@ static const char *set_personality(void) /************ Call this to reinitialize everything ***************/ void reset_global(void){ static proc_t p; + double uptime_secs; reset_selection_list(); look_up_our_self(&p); set_screen_size(); @@ -392,7 +394,8 @@ void reset_global(void){ negate_selection = 0; page_size = getpagesize(); running_only = 0; - seconds_since_boot = uptime(0,0); + seconds_since_boot = uptime(&uptime_secs,0); + jiffies_since_boot = ((long double)uptime_secs * Hertz); selection_list = NULL; simple_select = 0; sort_list = NULL; --- ps/output.c +++ ps/output.c 2013-05-29 11:17:11.345438367 +0000 @@ -128,6 +128,7 @@ static int sr_ ## NAME (const proc_t* P, #define cook_time(P) (P->utime + P->stime) / Hertz #define cook_etime(P) (((unsigned long long)seconds_since_boot >= (P->start_time / Hertz)) ? ((unsigned long long)seconds_since_boot - (P->start_time / Hertz)) : 0) +#define cook_jtime(P) (((unsigned long long)jiffies_since_boot >= (P->start_time / Hertz)) ? ((unsigned long long)jiffies_since_boot - (P->start_time / Hertz)) : 0) #define CMP_COOKED_TIME(NAME) \ static int sr_ ## NAME (const proc_t* P, const proc_t* Q) { \ @@ -477,11 +478,11 @@ static int pr_etimes(char *restrict cons static int pr_c(char *restrict const outbuf, const proc_t *restrict const pp){ unsigned long long total_time; /* jiffies used by this process */ unsigned pcpu = 0; /* scaled %cpu, 99 means 99% */ - unsigned long long seconds; /* seconds of process life */ + unsigned long long jiffies; /* jiffies of process life */ total_time = pp->utime + pp->stime; if(include_dead_children) total_time += (pp->cutime + pp->cstime); - seconds = cook_etime(pp); - if(seconds) pcpu = (total_time * 100ULL / Hertz) / seconds; + jiffies = cook_jtime(pp); + if(jiffies) pcpu = (total_time * 100ULL / Hertz) / jiffies; if (pcpu > 99U) pcpu = 99U; return snprintf(outbuf, COLWID, "%2u", pcpu); } @@ -489,11 +490,11 @@ static int pr_c(char *restrict const out static int pr_pcpu(char *restrict const outbuf, const proc_t *restrict const pp){ unsigned long long total_time; /* jiffies used by this process */ unsigned pcpu = 0; /* scaled %cpu, 999 means 99.9% */ - unsigned long long seconds; /* seconds of process life */ + unsigned long long jiffies; /* jiffies of process life */ total_time = pp->utime + pp->stime; if(include_dead_children) total_time += (pp->cutime + pp->cstime); - seconds = cook_etime(pp); - if(seconds) pcpu = (total_time * 1000ULL / Hertz) / seconds; + jiffies = cook_jtime(pp); + if(jiffies) pcpu = (total_time * 1000ULL / Hertz) / jiffies; if (pcpu > 999U) return snprintf(outbuf, COLWID, "%u", pcpu/10U); return snprintf(outbuf, COLWID, "%u.%u", pcpu/10U, pcpu%10U); @@ -502,11 +503,11 @@ static int pr_pcpu(char *restrict const static int pr_cp(char *restrict const outbuf, const proc_t *restrict const pp){ unsigned long long total_time; /* jiffies used by this process */ unsigned pcpu = 0; /* scaled %cpu, 999 means 99.9% */ - unsigned long long seconds; /* seconds of process life */ + unsigned long long jiffies; /* jiffies of process life */ total_time = pp->utime + pp->stime; if(include_dead_children) total_time += (pp->cutime + pp->cstime); - seconds = cook_etime(pp); - if(seconds) pcpu = (total_time * 1000ULL / Hertz) / seconds; + jiffies = cook_jtime(pp); + if(jiffies) pcpu = (total_time * 1000ULL / Hertz) / jiffies; if (pcpu > 999U) pcpu = 999U; return snprintf(outbuf, COLWID, "%3u", pcpu); } ++++++ procps-ng-3.3.8-bnc634071_procstat2.diff ++++++ --- proc/ksym.c +++ proc/ksym.c 2012-06-04 10:06:03.792202072 +0000 @@ -41,7 +41,7 @@ #define KSYMS_FILENAME "/would/be/nice/to/have/this/file" #define SYSMAP_FILENAME "/home/albert/ps/45621/System.map-hacked" #define linux_version_code 131598 /* ? */ -#define smp_num_cpus 2 +#define smp_num_cpus() 2 #endif #if 0 @@ -49,7 +49,7 @@ #define KSYMS_FILENAME "/home/albert/ps/45621/ksyms-2.3.12" #define SYSMAP_FILENAME "/home/albert/ps/45621/System.map-2.3.12" #define linux_version_code 131852 /* 2.3.12 */ -#define smp_num_cpus 2 +#define smp_num_cpus() 2 #endif #if 0 @@ -57,7 +57,7 @@ #define KSYMS_FILENAME "/home/albert/ps/45621/ksyms-2.3.18ac8-MODVERS" #define SYSMAP_FILENAME "/home/albert/ps/45621/System.map-2.3.18ac8-MODVERS" #define linux_version_code 131858 /* 2.3.18ac8 */ -#define smp_num_cpus 2 +#define smp_num_cpus() 2 #endif #if 0 @@ -65,7 +65,7 @@ #define KSYMS_FILENAME "/home/albert/ps/45621/ksyms-2.3.18ac8-NOMODVERS" #define SYSMAP_FILENAME "/home/albert/ps/45621/System.map-2.3.18ac8-NOMODVERS" #define linux_version_code 131858 /* 2.3.18ac8 */ -#define smp_num_cpus 2 +#define smp_num_cpus() 2 #endif /* These are the symbol types, with relative popularity: --- proc/sysinfo.c +++ proc/sysinfo.c 2013-05-29 11:26:47.797640941 +0000 @@ -37,8 +37,6 @@ #include <netinet/in.h> /* htons */ #endif -long smp_num_cpus; /* number of CPUs */ - #define BAD_OPEN_MESSAGE \ "Error: /proc must be mounted\n" \ " To mount /proc at boot you need an /etc/fstab line like:\n" \ @@ -200,7 +198,7 @@ static void old_Hertz_hack(void){ free(savelocale); jiffies = user_j + nice_j + sys_j + other_j + wait_j + hirq_j + sirq_j + stol_j ; seconds = (up_1 + up_2) / 2; - h = (unsigned)( (double)jiffies/seconds/smp_num_cpus ); + h = (unsigned)( (double)jiffies/seconds/smp_num_cpus() ); /* actual values used by 2.4 kernels: 32 64 100 128 1000 1024 1200 */ switch(h){ case 9 ... 11 : Hertz = 10; break; /* S/390 (sometimes) */ @@ -271,8 +269,6 @@ static void init_libproc(void){ have_privs = check_for_privs(); init_Linux_version(); /* Must be called before we check code */ - cpuinfo(); - #ifdef __linux__ if(linux_version_code > LINUX_VERSION(2, 4, 0)){ Hertz = find_elf_note(AT_CLKTCK); @@ -1012,7 +1008,12 @@ out: /////////////////////////////////////////////////////////////////////////// -void cpuinfo (void) { +long smp_num_cpus (void) { + static long _smp_num_cpus=-1; + + if (_smp_num_cpus != -1) + return(_smp_num_cpus); + // ought to count CPUs in /proc/stat instead of relying // on glibc, which foolishly tries to parse /proc/cpuinfo // note: that may have been the case but now /proc/stat @@ -1024,7 +1025,9 @@ void cpuinfo (void) { // _SC_NPROCESSORS_CONF returns 2, resulting in HZ=512 // _SC_NPROCESSORS_ONLN returns 1, which should work OK - smp_num_cpus = sysconf(_SC_NPROCESSORS_ONLN); - if (smp_num_cpus<1) /* SPARC glibc is buggy */ - smp_num_cpus=1; + _smp_num_cpus = sysconf(_SC_NPROCESSORS_ONLN); + if (_smp_num_cpus<1) /* SPARC glibc is buggy */ + _smp_num_cpus=1; + + return _smp_num_cpus; } --- proc/sysinfo.h +++ proc/sysinfo.h 2012-06-04 10:04:15.812509959 +0000 @@ -7,7 +7,7 @@ EXTERN_C_BEGIN extern unsigned long long Hertz; /* clock tick frequency */ -extern long smp_num_cpus; /* number of CPUs */ +extern long smp_num_cpus(void); /* number of CPUs */ extern int have_privs; /* boolean, true if setuid or similar */ #if 0 @@ -137,7 +137,5 @@ extern unsigned int getslabinfo (struct extern unsigned get_pid_digits(void) FUNCTION; -extern void cpuinfo (void); - EXTERN_C_END #endif /* SYSINFO_H */ --- top/top.c +++ top/top.c 2013-05-29 11:28:34.945439635 +0000 @@ -411,7 +411,7 @@ static void bye_bye (const char *str) { , LINUX_VERSION_PATCH(linux_version_code) , procps_version , (unsigned)Hertz, (unsigned)sizeof(Hertz), (unsigned)sizeof(Hertz) * 8 - , Page_size, Cpu_faux_tot, (int)smp_num_cpus, (unsigned)sizeof(CPU_t) + , Page_size, Cpu_faux_tot, (int)smp_num_cpus(), (unsigned)sizeof(CPU_t) , (unsigned)sizeof(HST_t), Page_size / (unsigned)sizeof(HST_t), HHist_siz , (unsigned)sizeof(proc_t), (unsigned)sizeof(p->cmd), (unsigned)sizeof(proc_t*) , (long)Frames_libflags @@ -2230,7 +2230,7 @@ static void zap_fieldstab (void) { /*** hotplug_acclimated ***/ Fieldstab[P_CPN].width = 1; - if (1 < (digits = (unsigned)snprintf(buf, sizeof(buf), "%u", (unsigned)smp_num_cpus))) { + if (1 < (digits = (unsigned)snprintf(buf, sizeof(buf), "%u", (unsigned)smp_num_cpus()))) { if (5 < digits) error_exit(N_txt(FAIL_widecpu_txt)); Fieldstab[P_CPN].width = digits; } @@ -2238,9 +2238,9 @@ static void zap_fieldstab (void) { #ifdef BOOST_PERCNT Cpu_pmax = 99.9; Fieldstab[P_CPU].width = 5; - if (Rc.mode_irixps && smp_num_cpus > 1 && !Thread_mode) { - Cpu_pmax = 100.0 * smp_num_cpus; - if (smp_num_cpus > 10) { + if (Rc.mode_irixps && smp_num_cpus() > 1 && !Thread_mode) { + Cpu_pmax = 100.0 * smp_num_cpus(); + if (smp_num_cpus() > 10) { if (Cpu_pmax > 99999.0) Cpu_pmax = 99999.0; } else { if (Cpu_pmax > 999.9) Cpu_pmax = 999.9; @@ -2249,9 +2249,9 @@ static void zap_fieldstab (void) { #else Cpu_pmax = 99.9; Fieldstab[P_CPU].width = 4; - if (Rc.mode_irixps && smp_num_cpus > 1 && !Thread_mode) { - Cpu_pmax = 100.0 * smp_num_cpus; - if (smp_num_cpus > 10) { + if (Rc.mode_irixps && smp_num_cpus() > 1 && !Thread_mode) { + Cpu_pmax = 100.0 * smp_num_cpus(); + if (smp_num_cpus() > 10) { if (Cpu_pmax > 99999.0) Cpu_pmax = 99999.0; } else { if (Cpu_pmax > 999.9) Cpu_pmax = 999.9; @@ -2294,8 +2294,8 @@ static void zap_fieldstab (void) { * cpus[sumSLOT] == tics from the 1st /proc/stat line * [ and beyond sumSLOT == tics for each cpu NUMA node ] */ static CPU_t *cpus_refresh (CPU_t *cpus) { - #define sumSLOT ( smp_num_cpus ) - #define totSLOT ( 1 + smp_num_cpus + Numa_node_tot) + #define sumSLOT ( smp_num_cpus() ) + #define totSLOT ( 1 + smp_num_cpus() + Numa_node_tot) static FILE *fp = NULL; static int siz, sav_slot = -1; static char *buf; @@ -2358,7 +2358,7 @@ static CPU_t *cpus_refresh (CPU_t *cpus) we'll force it to be treated as 'idle' so as not to present misleading percentages. */ cpus[sumSLOT].edge = - ((cpus[sumSLOT].cur.tot - cpus[sumSLOT].sav.tot) / smp_num_cpus) / (100 / TICS_EDGE); + ((cpus[sumSLOT].cur.tot - cpus[sumSLOT].sav.tot) / smp_num_cpus()) / (100 / TICS_EDGE); #endif #ifndef NUMA_DISABLE @@ -2496,7 +2496,7 @@ static void procs_hlp (proc_t *this) { oldtimev.tv_usec = timev.tv_usec; // if in Solaris mode, adjust our scaling for all cpus - Frame_etscale = 100.0f / ((float)Hertz * (float)et * (Rc.mode_irixps ? 1 : smp_num_cpus)); + Frame_etscale = 100.0f / ((float)Hertz * (float)et * (Rc.mode_irixps ? 1 : smp_num_cpus())); #ifdef OFF_HST_HASH maxt_sav = Frame_maxtask; #endif @@ -2649,8 +2649,7 @@ static void sysinfo_refresh (int forced) #ifndef PRETEND8CPUS /*** hotplug_acclimated ***/ if (300 <= cur_secs - cpu_secs) { - cpuinfo(); - Cpu_faux_tot = smp_num_cpus; + Cpu_faux_tot = smp_num_cpus(); cpu_secs = cur_secs; #ifndef NUMA_DISABLE if (Libnuma_handle) @@ -3219,9 +3219,8 @@ static void before (char *me) { // establish cpu particulars #ifdef PRETEND8CPUS - smp_num_cpus = 8; + Cpu_faux_tot = 8; #endif - Cpu_faux_tot = smp_num_cpus; Cpu_States_fmts = N_unq(STATE_lin2x4_fmt); if (linux_version_code > LINUX_VERSION(2, 5, 41)) Cpu_States_fmts = N_unq(STATE_lin2x5_fmt); @@ -5020,19 +5019,19 @@ static void summary_show (void) { if (CHKw(w, View_CPUNOD)) { if (Numa_node_sel < 0) { // display the 1st /proc/stat line, then the nodes (if room) - summary_hlp(&smpcpu[smp_num_cpus], N_txt(WORD_allcpus_txt)); + summary_hlp(&smpcpu[smp_num_cpus()], N_txt(WORD_allcpus_txt)); Msg_row += 1; // display each cpu node's states for (i = 0; i < Numa_node_tot; i++) { if (!isROOM(anyFLG, 1)) break; snprintf(tmp, sizeof(tmp), N_fmt(NUMA_nodenam_fmt), i); - summary_hlp(&smpcpu[1 + smp_num_cpus + i], tmp); + summary_hlp(&smpcpu[1 + smp_num_cpus() + i], tmp); Msg_row += 1; } } else { // display the node summary, then the associated cpus (if room) snprintf(tmp, sizeof(tmp), N_fmt(NUMA_nodenam_fmt), Numa_node_sel); - summary_hlp(&smpcpu[1 + smp_num_cpus + Numa_node_sel], tmp); + summary_hlp(&smpcpu[1 + smp_num_cpus() + Numa_node_sel], tmp); Msg_row += 1; for (i = 0; i < Cpu_faux_tot; i++) { if (Numa_node_sel == smpcpu[i].node) { ++++++ procps-ng-3.3.8-bnc634840.patch ++++++ Do not setup SIGHUP signal handler if we are in the batch mode Top enables a signal handler for the SIGHUP signal (loss of terminal). While this makes sense for top's default interactive mode, it doesn't make any sense for batch mode. If you run top in nohup just to collect data over time and disconnect top finishes which is not what one would expect. Index: procps-3.2.8/top.c --- top/top.c +++ top/top.c 2013-05-29 13:44:08.245439364 +0200 @@ -3268,7 +3268,13 @@ static void before (char *me) { sa.sa_flags = 0; for (i = SIGRTMAX; i; i--) { switch (i) { - case SIGALRM: case SIGHUP: case SIGINT: + case SIGHUP: + if (Batch) + sa.sa_handler = SIG_IGN; + else + sa.sa_handler = sig_endpgm; + break; + case SIGALRM: case SIGINT: case SIGPIPE: case SIGQUIT: case SIGTERM: case SIGUSR1: case SIGUSR2: sa.sa_handler = sig_endpgm; ++++++ procps-ng-3.3.8-petabytes.patch ++++++ --- top/top.c +++ top/top.c 2013-05-29 11:57:32.849439427 +0000 @@ -1496,9 +1496,9 @@ static inline const char *make_str (cons static const char *scale_mem (int target, unsigned long num, int width, int justr) { #ifndef NOBOOST_MEMS // SK_Kb SK_Mb SK_Gb SK_Tb SK_Pb SK_Eb - static const char *fmttab[] = { "%.0f", "%#.1f%c", "%#.3f%c", "%#.3f%c", "%#.3f%c", NULL }; + static const char *fmttab[] = { "%.0f", "%#.1f%c", "%#.3f%c", "%#.3f%c", "%#.3f%c", "%#.3f%c", NULL }; #else - static const char *fmttab[] = { "%.0f", "%.0f%c", "%.0f%c", "%.0f%c", "%.0f%c", NULL }; + static const char *fmttab[] = { "%.0f", "%.0f%c", "%.0f%c", "%.0f%c", "%.0f%c", "%.0f%c", NULL }; #endif static char buf[SMLBUFSIZ]; float scaled_num; @@ -1510,7 +1510,7 @@ static const char *scale_mem (int target goto end_justifies; scaled_num = num; - for (i = SK_Kb, psfx = Scaled_sfxtab; i < SK_Eb; psfx++, i++) { + for (i = SK_Kb, psfx = Scaled_sfxtab; i <= SK_Eb; psfx++, i++) { if (i >= target && (width >= snprintf(buf, sizeof(buf), fmttab[i], scaled_num, *psfx))) goto end_justifies; ++++++ procps-ng-3.3.8-readeof.patch ++++++ --- proc/readproc.c +++ proc/readproc.c 2013-05-29 10:55:48.129939330 +0000 @@ -544,7 +544,7 @@ static int file2str(const char *director if (ub->buf) ub->buf[0] = '\0'; else ub->buf = xcalloc((ub->siz = buffGRW)); sprintf(path, "%s/%s", directory, what); - if (-1 == (fd = open(path, O_RDONLY, 0))) return -1; + if (-1 == (fd = open(path, O_RDONLY, O_NOATIME))) return -1; while (0 < (num = read(fd, ub->buf + tot_read, ub->siz - tot_read))) { tot_read += num; if (tot_read < ub->siz) break; @@ -559,41 +559,42 @@ static int file2str(const char *director static char** file2strvec(const char* directory, const char* what) { char buf[2048]; /* read buf bytes at a time */ - char *p, *rbuf = 0, *endbuf, **q, **ret; - int fd, tot = 0, n, c, end_of_file = 0; - int align; + char *p, *rbuf = (char*)0, *endbuf, **q, **ret; + int fd, c; + ssize_t n, align, tot = 0; sprintf(buf, "%s/%s", directory, what); - fd = open(buf, O_RDONLY, 0); + fd = open(buf, O_RDONLY, O_NOATIME); if(fd==-1) return NULL; /* read whole file into a memory buffer, allocating as we go */ - while ((n = read(fd, buf, sizeof buf - 1)) >= 0) { - if (n < (int)(sizeof buf - 1)) - end_of_file = 1; - if (n == 0 && rbuf == 0) { - close(fd); - return NULL; /* process died between our open and read */ - } + do { + n = read(fd, buf, sizeof(buf) - 1); if (n < 0) { - if (rbuf) - free(rbuf); - close(fd); - return NULL; /* read error */ + tot = 0; + break; /* read error! */ + } + if (n == 0) { + if(rbuf == (char*)0) + tot = 0; /* process died between our open and read */ + break; /* we're done */ } - if (end_of_file && (n == 0 || buf[n-1]))/* last read char not null */ - buf[n++] = '\0'; /* so append null-terminator */ rbuf = xrealloc(rbuf, tot + n); /* allocate more memory */ memcpy(rbuf + tot, buf, n); /* copy buffer into it */ tot += n; /* increment total byte ctr */ - if (end_of_file) - break; - } + } while (n >= (sizeof(buf) - 1)); + close(fd); - if (n <= 0 && !end_of_file) { + + if (tot == 0) { if (rbuf) free(rbuf); - return NULL; /* read error */ + return NULL; /* read error */ + } + if (rbuf[tot-1]) { /* last read char not null */ + rbuf = xrealloc(rbuf, tot + 1); /* allocate more memory */ + rbuf[tot++] = '\0'; /* and append null-terminator */ } + endbuf = rbuf + tot; /* count space for pointers */ align = (sizeof(char*)-1) - ((tot + sizeof(char*)-1) & (sizeof(char*)-1)); for (c = 0, p = rbuf; p < endbuf; p++) { @@ -626,7 +627,7 @@ static int read_unvectored(char *restric unsigned n = 0; snprintf(path, sizeof(path), "%s/%s", whom, what); - fd = open(path, O_RDONLY); + fd = open(path, O_RDONLY, O_NOATIME); if(fd==-1) return 0; for(;;){ ++++++ procps-ng-3.3.8-selinux.patch ++++++ --- ps/Makefile.am +++ ps/Makefile.am 2013-05-29 11:00:12.549939319 +0000 @@ -3,7 +3,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -DLOCALEDIR=\"$(localedir)\" -AM_LDFLAGS = ../proc/libprocps.la +AM_LDFLAGS = ../proc/libprocps.la -ldl if WITH_SYSTEMD AM_LDFLAGS += @SYSTEMD_LIBS@ --- ps/output.c +++ ps/output.c 2013-05-29 11:02:06.109939431 +0000 @@ -1282,6 +1282,7 @@ fail: /****************** FLASK & seLinux security stuff **********************/ // move the bulk of this to libproc sometime +#if 0 static int pr_context(char *restrict const outbuf, const proc_t *restrict const pp){ char filename[48]; size_t len; @@ -1310,7 +1311,7 @@ fail: return 1; } -#if 0 +#else // This needs more study, considering: // 1. the static linking option (maybe disable this in that case) // 2. the -z and -Z option issue --- ps/parser.c +++ ps/parser.c 2013-05-29 10:57:34.177440830 +0000 @@ -238,7 +238,7 @@ static const char *parse_sysv_option(voi // In the meantime, please do not add to it. The list is // intended to ONLY contain flags defined by the POSIX and UNIX // standards published by The Open Group, IEEE, and ISO. - if(!strchr("aAdefgGlnoptuU", *flagptr)) not_pure_unix = 1; // dude, -Z ain't in POSIX + if(!strchr("aAdefgGlnoptuUZ", *flagptr)) not_pure_unix = 1; // dude, -Z ain't in POSIX switch(*flagptr){ case 'A': --- ps/ps.1 +++ ps/ps.1 2012-06-01 15:22:45.268010363 +0000 @@ -423,6 +423,9 @@ option, which .B \-F implies. .TP +.BI \-Z +display security context format (SELinux, etc.) +.TP .BI \-\-format \ format user\-defined format. Identical to .B \-o --- w.c +++ w.c 2013-05-29 10:57:34.349888215 +0000 @@ -356,6 +356,12 @@ static const proc_t *getproc(const utmp_ continue; best = tmp; } + /* + * It is there but SELinux wouldn't allow us to know the detail. Really + * w should just be given rights + */ + if(!kill(u->ut_pid, 0) || errno != ESRCH) + *found_utpid = 1; return best ? best : secondbest; } ++++++ procps-ng-3.3.8-tinfo.dif ++++++ --- configure.ac +++ configure.ac 2013-05-29 13:25:27.693939536 +0000 @@ -137,9 +137,17 @@ else else WATCH_NCURSES_LIBS="$NCURSES_LIBS" fi + cf_tinfo="" + AC_CHECK_LIB(tinfo, setupterm, [cf_tinfo="tinfo"]) + if test x$cf_tinfo = xtinfo ; then + TOP_NCURSES_LIBS="-ltinfo" + else + TOP_NCURSES_LIBS="$NCURSES_LIBS" + fi fi AC_SUBST([NCURSES_LIBS]) AC_SUBST([WATCH_NCURSES_LIBS]) +AC_SUBST([TOP_NCURSES_LIBS]) AC_ARG_WITH([systemd], [AS_HELP_STRING([--with-systemd], [enable systemd support])], --- top/Makefile.am +++ top/Makefile.am 2012-06-04 10:58:15.024104602 +0000 @@ -19,7 +19,7 @@ top_SOURCES = \ dist_man_MANS = \ top.1 -top_LDADD = @NCURSES_LIBS@ +top_LDADD = @TOP_NCURSES_LIBS@ endif EXTRA_DIST = ++++++ procps-ng-3.3.8-top.1.diff ++++++ --- top/top.1 +++ top/top.1 2013-05-29 10:50:57.169939440 +0000 @@ -9,7 +9,7 @@ .. \# Setup //////////////////////////////////////////////////////////////// \# ** Comment out '.nr' or set to 0 to eliminate WIDTH fiddlin' ! -.nr half_xtra 4 +.nr half_xtra 0 . .ll +(\n[half_xtra] + \n[half_xtra]) . @@ -32,11 +32,11 @@ .ds F \fIOff\fR .ds O \fIOn\fR . -.ds AK asterisk (\'*\') +.ds AK asterisk ('*') .ds AM alternate\-display mode .ds AS auxiliary storage .ds CF configuration file -.ds CG \'current\' window/field group +.ds CG 'current' window/field group .ds CI interactive command \# - Note: our 'Command Line' used in 2 places \# ( and managed to fit in an 80x24 terminal ) @@ -44,7 +44,7 @@ \-\fBu\fR|\fBU\fR user \-\fBp\fR pid \-\fBo\fR fld \-\fBw\fR [cols] \fR .ds CO command\-line option .ds CT command toggle -.ds CW \'current\' window +.ds CW 'current' window .ds FG field group .ds FM full\-screen mode .ds KA arrow key @@ -1578,8 +1578,8 @@ It does not require that the window name .IP "*" 3 The \*(CIs shown with an \*(AK have use beyond \*(AM. .Bd -literal -compact - \'=', 'A', 'g' are always available - \'a', 'w' act the same with color mapping + '=', 'A', 'g' are always available + 'a', 'w' act the same with color mapping \ and fields management .Ed ++++++ procps-ng-3.3.8-watch.patch ++++++ --- configure.ac +++ configure.ac 2013-05-29 10:45:47.473939111 +0000 @@ -69,7 +69,7 @@ AC_FUNC_MMAP AC_FUNC_REALLOC AC_FUNC_STRTOD -usrbin_execdir='${exec_prefix}/usr/bin' +usrbin_execdir='${exec_prefix}/bin' AC_SUBST([usrbin_execdir]) AM_GNU_GETTEXT_VERSION([0.14.1]) --- proc/libprocps.sym +++ proc/libprocps.sym 2013-05-29 10:46:13.165439719 +0000 @@ -12,6 +12,7 @@ global: free_slabinfo; freeproc; get_pid_digits; + get_proc_stats; get_slabinfo; getbtime; getdiskstat; -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
