Bug 167970 - [patch] sysutils/htop miscalculates memory usage
Summary: [patch] sysutils/htop miscalculates memory usage
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-16 16:20 UTC by vsjcfm
Modified: 2012-05-29 22:30 UTC (History)
0 users

See Also:


Attachments
patch-Makefile (233 bytes, text/plain)
2012-05-16 16:20 UTC, vsjcfm
no flags Details
patch-ProcessList.c (2.28 KB, text/plain)
2012-05-16 16:20 UTC, vsjcfm
no flags Details
patch-Makefile (217 bytes, application/octet-stream)
2012-05-17 08:03 UTC, vsjcfm
no flags Details
patch-configure.ac (708 bytes, application/octet-stream)
2012-05-17 08:03 UTC, vsjcfm
no flags Details
patch-ProcessList.c (2.28 KB, text/x-csrc; charset=US-ASCII)
2012-05-17 08:03 UTC, vsjcfm
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description vsjcfm 2012-05-16 16:20:01 UTC
htop uses linux compability layer for memory calculation, but this
incorrect for FreeBSD.

Fix: Patch attached

--- ./configure.ac.orig 2011-12-26 23:46:57.000000000 +0200
+++ ./configure.ac      2012-05-16 17:39:50.000000000 +0300
@@ -23,11 +23,12 @@

 # Checks for libraries.
 AC_CHECK_LIB([m], [ceil], [], [missing_libraries="$missing_libraries libm"])
+AC_CHECK_LIB([kvm], [kvm_open], [],
[missing_libraries="$missing_libraries libkvm"])

 # Checks for header files.
 AC_HEADER_DIRENT
 AC_HEADER_STDC
-AC_CHECK_HEADERS([stdlib.h string.h strings.h sys/param.h sys/time.h
unistd.h curses.h],[:],[
+AC_CHECK_HEADERS([stdlib.h string.h strings.h sys/param.h sys/time.h
unistd.h curses.h kvm.h paths.h fcntl.h sys/sysctl.h],[:],[
   missing_headers="$missing_headers $ac_header"
 ])
 AC_CHECK_HEADERS([execinfo.h],[:],[:])
--- patch-configure.ac ends here ---
How-To-Repeat: Install htop & compare memory values reported by htop and top from base system
Comment 1 Edwin Groothuis freebsd_committer 2012-05-16 16:20:44 UTC
Maintainer of sysutils/htop,

Please note that PR ports/167970 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/167970

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer 2012-05-16 16:20:48 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 vsjcfm 2012-05-16 22:37:46 UTC
Oops, formatting is wrong. I can resend patches if needed.
Comment 4 vsjcfm 2012-05-17 08:03:56 UTC
Patches resend
Comment 5 Hung-Yi Chen 2012-05-27 21:02:41 UTC
Yes, I approve this patch.

Please commit it.
2012/5/16 Edwin Groothuis <edwin@freebsd.org>:
> Maintainer of sysutils/htop,
>
> Please note that PR ports/167970 has just been submitted.
>
> If it contains a patch for an upgrade, an enhancement or a bug fix
> you agree on, reply to this email stating that you approve the patch
> and a committer will take care of it.
>
> The full text of the PR can be found at:
> =A0 =A0http://www.freebsd.org/cgi/query-pr.cgi?pr=3Dports/167970
>
> --
> Edwin Groothuis via the GNATS Auto Assign Tool
> edwin@FreeBSD.org
Comment 6 Mark Linimon freebsd_committer freebsd_triage 2012-05-27 21:51:53 UTC
State Changed
From-To: feedback->open

Maintainer approved.
Comment 7 dfilter service freebsd_committer 2012-05-29 22:23:09 UTC
pawel       2012-05-29 21:22:56 UTC

  FreeBSD ports repository

  Modified files:
    sysutils/htop        Makefile 
  Added files:
    sysutils/htop/files  patch-ProcessList.c patch-configure.ac 
  Log:
  Add patches to show correct memory usage on FreeBSD
  
  PR:             ports/167970
  Submitted by:   Sayetsky Anton <vsjcfm@gmail.com>
  Approved by:    maintainer
  
  Revision  Changes    Path
  1.24      +1 -0      ports/sysutils/htop/Makefile
  1.7       +73 -0     ports/sysutils/htop/files/patch-ProcessList.c (new)
  1.6       +16 -0     ports/sysutils/htop/files/patch-configure.ac (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 8 Pawel Pekala freebsd_committer 2012-05-29 22:23:20 UTC
State Changed
From-To: open->closed

Committed. Thanks!