FreeBSD Bugzilla – Attachment 166902 Details for
Bug 207133
[MAINTAINER] sysutils/htop: Fix process memory calculation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
sysutils__htop.diff
sysutils__htop.diff (text/plain), 2.94 KB, created by
Hung-Yi Chen
on 2016-02-12 16:59:41 UTC
(
hide
)
Description:
sysutils__htop.diff
Filename:
MIME Type:
Creator:
Hung-Yi Chen
Created:
2016-02-12 16:59:41 UTC
Size:
2.94 KB
patch
obsolete
>Index: sysutils/htop/Makefile >=================================================================== >--- sysutils/htop/Makefile (revision 408741) >+++ sysutils/htop/Makefile (working copy) >@@ -18,6 +18,8 @@ > > CONFIGURE_ARGS= --enable-unicode > USES= autoreconf execinfo libtool ncurses python:2,build shebangfix >+SHEBANG_LANG= python2 >+SHEBANG_FILES= scripts/MakeHeader.py > USE_GITHUB= yes > GH_ACCOUNT= hishamhm > >Index: sysutils/htop/files/patch-freebsd__Battery.c >=================================================================== >--- sysutils/htop/files/patch-freebsd__Battery.c (nonexistent) >+++ sysutils/htop/files/patch-freebsd__Battery.c (working copy) >@@ -0,0 +1,27 @@ >+--- freebsd/Battery.c.orig 2016-02-13 00:30:03.804015000 +0800 >++++ freebsd/Battery.c 2016-02-13 00:31:05.662396000 +0800 >+@@ -6,10 +6,21 @@ >+ */ >+ >+ #include "BatteryMeter.h" >++#include <sys/sysctl.h> >+ >+ void Battery_getData(double* level, ACPresence* isOnAC) { >+- // TODO >+- *level = -1; >+- *isOnAC = AC_ERROR; >++ int life; >++ size_t life_len = sizeof(life); >++ if (sysctlbyname("hw.acpi.battery.life", &life, &life_len, NULL, 0) == -1) >++ *level = -1; >++ else >++ *level = life; >++ >++ int acline; >++ size_t acline_len = sizeof(acline); >++ if (sysctlbyname("hw.acpi.acline", &acline, &acline_len, NULL, 0) == -1) >++ *isOnAC = AC_ERROR; >++ else >++ *isOnAC = acline == 0 ? AC_ABSENT : AC_PRESENT; >+ } >+ > >Property changes on: sysutils/htop/files/patch-freebsd__Battery.c >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: sysutils/htop/files/patch-freebsd__FreeBSDProcessList.c >=================================================================== >--- sysutils/htop/files/patch-freebsd__FreeBSDProcessList.c (nonexistent) >+++ sysutils/htop/files/patch-freebsd__FreeBSDProcessList.c (working copy) >@@ -0,0 +1,13 @@ >+--- freebsd/FreeBSDProcessList.c.orig 2016-02-13 00:37:56.160832000 +0800 >++++ freebsd/FreeBSDProcessList.c 2016-02-13 00:38:19.671290000 +0800 >+@@ -477,8 +477,8 @@ >+ } >+ >+ // from FreeBSD source /src/usr.bin/top/machine.c >+- proc->m_size = kproc->ki_size / 1024; >+- proc->m_resident = kproc->ki_rssize * pageSizeKb; >++ proc->m_size = kproc->ki_size / 1024 / pageSizeKb; >++ proc->m_resident = kproc->ki_rssize; >+ proc->nlwp = kproc->ki_numthreads; >+ proc->time = (kproc->ki_runtime + 5000) / 10000; >+ > >Property changes on: sysutils/htop/files/patch-freebsd__FreeBSDProcessList.c >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 207133
: 166902