NetBSD Problem Report #47422

From www@NetBSD.org  Tue Jan  8 20:32:32 2013
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id 25E1363E857
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  8 Jan 2013 20:32:32 +0000 (UTC)
Message-Id: <20130108203231.3359263E857@www.NetBSD.org>
Date: Tue,  8 Jan 2013 20:32:31 +0000 (UTC)
From: bbartlomiej@gmail.com
Reply-To: bbartlomiej@gmail.com
To: gnats-bugs@NetBSD.org
Subject: htop doesn't show cpu usage for processes
X-Send-Pr-Version: www-1.0

>Number:         47422
>Category:       pkg
>Synopsis:       htop doesn't show cpu usage for processes
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 08 20:35:00 +0000 2013
>Closed-Date:    Sat May 28 18:14:59 +0000 2016
>Last-Modified:  Sun May 29 08:10:00 +0000 2016
>Originator:     Bartek Krawczyk
>Release:        6.0.1
>Organization:
>Environment:
NetBSD test.tveurosat.net 6.0.1 NetBSD 6.0.1 (XEN3_DOMU) amd64
>Description:
Hi, htop from pkgsrc 2012Q4 doesn't report cpu usage for processes. Everything is 0.0. On the top pane I can see cpu usage of about 30% but none of the processes seems (according to htop) to cause that. "top" behaves correctly and shows that httpd is using 30% of cpu.

 load averages:  0.25,  0.39,  0.62;               up 0+23:02:07        21:30:12
45 processes: 43 sleeping, 2 on CPU
CPU0 states:  1.9% user,  0.0% nice,  0.0% system,  0.0% interrupt, 98.1% idle
CPU1 states:  0.0% user,  0.0% nice,  0.0% system,  0.0% interrupt,  100% idle
CPU2 states:  0.0% user,  0.0% nice,  0.0% system,  0.0% interrupt,  100% idle
CPU3 states:  3.1% user,  0.0% nice,  0.6% system,  0.0% interrupt, 96.3% idle
Memory: 1140M Act, 566M Inact, 6076K Wired, 37M Exec, 1368M File, 24M Free
Swap: 2048M Total, 2048M Free

  PID USERNAME PRI NICE   SIZE   RES STATE      TIME   WCPU    CPU COMMAND
16249 www       85    0   219M   40M select/2   7:24 11.57% 11.57% httpd


^^ as you can se top shows CPU/WCPU for httpd
 and at the same time htop shows CPU% as 0.0. MEM% is also 0.0 in htop. And it is the same for every running process.


>How-To-Repeat:
build htop from pkgsrc 2012Q4 and run it.
>Fix:
not known

>Release-Note:

>Audit-Trail:
From: "Jeremy C. Reed" <reed@reedmedia.net>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/47422: htop doesn't show cpu usage for process
Date: Mon, 14 Jan 2013 18:39:25 -0600 (CST)

 I saw some messages saying similar problems with FreeBSD and MacOSX.
 FreeBSD I think uses kvm and libexecinfo. MacOSX requires root 
 privilege.

 I started to look at this, but it requires /proc/stat (according to 
 ktrace).  But no MESSAGE file about this.

From: coypu@SDF.ORG
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/47422: htop doesn't show cpu usage for processes
Date: Sat, 28 May 2016 15:42:39 +0000

 This is no longer true at least as of htop 2.0.1, NetBSD-7.99.29
 (related: kern/50801)

   1  [                     0.0%]    4  [                     0.0%]   7  [                     0.0%]    10 [|||||||||           31.8%]
   2  [                     0.0%]    5  [|                    1.3%]   8  [|                    0.7%]    11 [|                    1.3%]
   3  [                     0.0%]    6  [                     0.0%]   9  [                     0.0%]    12 [                     0.0%]
   Mem[||||||||||||||||||||||||||||||||||||||||||||||||16.0Z/15.4G]   Tasks: 35, 0 thr; 1 running
   Swp[                                                   0K/15.8G]   Load average: 0.02 0.39 0.39 
                                                                      Uptime: 01:37:07

     PID USER      PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command
    2439 fly        85   0 1966M 1222M     0 S 87.4  7.8  5:00.50 firefox
    2469 fly        85   0  335M  5668     0 S  7.9  0.0  0:07.67 /usr/pkg/bin/pulseaudio --start --log-target=syslog
 ...

 Feel free to close.

 (16.0Z/15.4G is still a bug, though)

From: coypu@SDF.ORG
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/47422: htop doesn't show cpu usage for processes
Date: Sat, 28 May 2016 15:56:13 +0000

 Unsure about the /proc MESSAEG thing. is it off by default for some
 platforms (-6)?

 and yes, it exclusively uses /proc for info. it can be made to work
 without it, but that's not trivial.

State-Changed-From-To: open->closed
State-Changed-By: bsiegert@NetBSD.org
State-Changed-When: Sat, 28 May 2016 18:14:59 +0000
State-Changed-Why:
Apparently no longer an issue.


From: coypu@SDF.ORG
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/47422: htop doesn't show cpu usage for processes
Date: Sun, 29 May 2016 08:07:45 +0000

 Note that for OpenBSD, FreeBSD, and OS X, "native" ports were made, not
 requiring /proc (seen by some as linux compatibility).
 This is why the question of whether a MESSAGE about /proc is getting
 less certain.
 It is just SmartOS, Linux and NetBSD that use /proc with htop now.
 Missing mem% was a NetBSD problem with /proc, and fixed in -current.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.