Coder Social home page Coder Social logo

hishamhm / htop Goto Github PK

View Code? Open in Web Editor NEW
5.8K 141.0 583.0 2.63 MB

htop is an interactive text-mode process viewer for Unix systems. It aims to be a better 'top'.

License: GNU General Public License v2.0

C 89.88% C++ 1.81% Shell 0.01% Python 0.41% Lua 2.77% Makefile 0.98% M4 2.07% Objective-C 0.08% Roff 1.99%
c terminal process-monitor htop tui system console console-application linux freebsd

htop's Introduction

htop

by Hisham Muhammad [email protected]

This repository is archived as htop is now maintained by a team of volunteers at htop.dev using an organisation-based git repository.

License

GNU General Public License, version 2 (GPL-2.0)

htop's People

Contributors

alanbarr avatar andrestc avatar coypoop avatar deric avatar dkgroot avatar elitetk avatar etosan avatar eworm-de avatar explorer09 avatar fasterit avatar gaod avatar guoci avatar hishamhm avatar jrtc27 avatar jweyrich avatar kaefer avatar kayvlim avatar lancechentw avatar mmcco avatar multiplexd avatar nckx avatar pmalhaire avatar rbuj avatar rindeal avatar rsaxvc avatar sp1l avatar tcreech avatar trebmuh avatar valpackett avatar wangqr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

htop's Issues

Blank meter

Would it be possible to add a "Blank" meter to the list of available meters. This could simply be a text meter with no text in it. I would be useful to arrange the other meters without adding information I am not interested in just to line up the meters the way I want. Figured it would be an easy add.

Not all processes are drawn

I'm using the current git of htop and there is a case in which processes gets hidden. Just open htop in a terminal which uses only a part of the screen, go down to the last process and then maximize the terminal. Now htop displays only a few processes as the most processes are hidden behind the top.

Feature: make it possible to combine "show custom thread names" with full path / basename

When I turn on "show custom thread names" the full path of application with its name get hidden and only the custom name of thread is shown.

This makes it hard to figure out to which process the thread belongs. I understand that some screens may have problems showing so long line, but it would be still nice to have an option to display both if user wants it.

process tree folding, similar to code folding

It would be awesome to have the option to collapse and expand branches of the process tree in tree view. Switching to a different sort order is great to show you what is using the most CPU or memory or something, but can also be very disorienting.

Htop suddenly crushes.

Hello, I found strage bug, that crushes htop. Steps to reproduce bug:

  1. start htop
  2. click on process list
  3. open process filter (F4)
  4. type some symbols ('qwe' works well)
  5. sometimes wait a couple of seconds
  6. get this on Gentoo:
htop 1.0.1 aborting. Please report bug at http://htop.sf.net
Backtrace: 
htop[0x40a68f]
/lib64/libc.so.6(+0x37bd0)[0x7ffe35f81bd0]
htop(main+0x80d)[0x406b3d]
/lib64/libc.so.6(__libc_start_main+0xed)[0x7ffe35f6e3dd]
htop[0x408b5d]
Aborted

or on Ubuntu:

htop 1.0.1 aborting. Please report bug at http://htop.sf.net
Backtrace: 
htop[0x8050cba]
[0xb76f4400]
htop(main+0x95d)[0x804c81d]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0xb74d34d3]
htop[0x804efc5]
Aborted (core dumped)

I want to change one colour in the default colour scheme

I want to compile htop, after having changed one of the colours in the default colour scheme. I want to to do this as elements in htop in this colour cannot be seen, as I have decided to give the solarized theme (in my terminals) another go giving up a couple of years ago.

The grey ANSI elements (bright black?), like the percentage values in the meter bars and the non current user usernames are not visible.

I want to change them from grey to ANSI bright green (not in bold). This should appear as a dark grey in the solarized theme.

It seems that the running processes number at the top right uses the same colour.

How do I do this? I had a look at the CRT.c file, but I have no idea what I am doing.

Cheers.

Replace the uptime (!) easter egg with ;-)

With an uptime above 100 days htop displays a (!) after the number of days.
This is misleading and people have been wasting time, thinking that it meant something was wrong with the machine. I suggest to replace the (!) in UptimeMeter.c with the friendlier and not misleading ;-).

I patched my binary version:

  perl -pi -e 's/days\(\!\)/days;-)/' /usr/bin/htop

and am pleased with the result:
Uptime: 315 days;-), 02:03:35

htop doesn't display virtual size larger than 4 tebibytes correctly

At 8 tebibytes, field "overflows" and breaks the UI. At 16 and larger, field is truncated and display something like 38588, as if it were kibibytes.

Plain "top" displays all those values correctly. The bug in "htop" is confirmed on Linux and FreeBSD.
8t
64t

Here's sample Python program that uses so much memory:
(don't worry, it won't crash your computer because it doesn't allocate any physical pages at all)

import os
import mmap

TEBIBYTE = 2 ** 40

fd = os.open("/dev/zero", os.O_RDONLY)
lol = mmap.mmap(fd, TEBIBYTE * 8, prot=mmap.PROT_READ)

Monitor disk activity

It would be excellent if htop could monitor disk activity, like the way iostat does. Key stats would include reads, writes, iowait time, etc.

htop doesn't display all kernel thread names

Running htop 1.0.2 (self-compiled) on a mipsel STB; OS is linux 2.6.22.

Not all kernel thread names are shown, and if you specify to hide kernel threads, the ones without names aren't hidden.

I've found that you identify kernel threads by PGRP=0, but in this case PGRP=1.

Here is a screenshot and (part of...) contents of /proc/*/stat

appunti windows-1

cat /proc/*/stat 2> /dev/null

1 (init) S 0 1 1 0 -1 2151678208 797 2843536 34 218092 8 434 867981 633482 1 0 1 0 28 1781760 69 2147483647 4194304 4223044 2139578160 2139576664 716826584 0 0 2117163772 26125315 2416678956 0 0 0 0 0 0 0
12975 (pdflush) S 2 0 0 0 -1 2155876416 0 0 0 0 0 54 0 0 1 0 1 0 7533859 0 0 2147483647 0 0 0 0 0 0 0 2147483647 0 2416449880 0 0 18 0 0 0 0
13912 (kVcxoRegulate) S 2 1 1 0 -1 2151678016 0 0 0 0 0 0 0 0 1 0 1 0 1132363 0 0 2147483647 0 0 0 0 0 0 2147483391 1073745920 1834 3365978960 0 0 18 0 0 0 0
13913 (kMonitorVideo) S 2 1 1 0 -1 2151678016 0 0 0 0 0 211 0 0 1 0 1 0 1132363 0 0 2147483647 0 0 0 0 0 0 2147483391 1073745920 1834 3364634884 0 0 18 0 0 0 0
13914 (kTask1) S 2 1 1 0 -1 2151678016 0 0 0 0 0 1673 0 0 1 0 1 0 1132363 0 0 2147483647 0 0 0 0 0 0 2147483391 1073745920 1834 3364634884 0 0 18 0 0 0 0
13915 (kTask2) S 2 1 1 0 -1 2151678016 0 0 0 0 0 123 0 0 1 0 1 0 1132363 0 0 2147483647 0 0 0 0 0 0 2147483391 1073745920 1834 3364634884 0 0 18 0 0 0 0
13916 (kTask3) S 2 1 1 0 -1 2151678016 0 0 0 0 0 127 0 0 1 0 1 0 1132363 0 0 2147483647 0 0 0 0 0 0 2147483391 1073745920 1834 3364634884 0 0 18 0 0 0 0
14439 (smbd) S 1606 1606 1606 0 -1 2151678272 576 0 46 0 24 20 0 0 1 0 1 0 7676114 7581696 147 2147483647 1431633920 1435164836 2141441712 2141440824 717697000 0 69760 0 181793 2419363620 0 0 18 0 0 0 0
....

Implement optional vi movement keys for scrolling, etc

Laptops often have small arrow keys, and hitting page up/down often requires hitting the fn key as well. Having the ability to toggle this functionality will make htop easier for mobile users as well as people who are used to vi movement keys.

Forked and will check this out soon

ZFS buffer/cache is counted under used memory

I'm running zfsonlinux and htop is counting the ZFS ARC (memory) cache under normal used memory.

This is because ZFS doesn't use normal Linux memory cache but it's own version.

It would be useful if htop could detect if ZFS is running (maybe checking for /dev/zfs) and in that case show the memory used by ZFS cache in a different colour or maybe joined with the normal buffers/cache.

ARC used memory can be checked in /proc/spl/kstat/zfs/arcstats (size):

# grep ^size /proc/spl/kstat/zfs/arcstats 
size                            4    3533162592

[Mac] Htop aborted

Mac OSX 10.9.2
$ brew install htop
$ htop
htop 0.8.2.2 aborted. Please report bug at http://htop.sf.net

when viewing in tree mode be able to collapse based on PID

Is it possible to be able to collapse process tree's when in tree mode. Say if i have PID 23 with 22 processes who have PID 22 as their PPID. It would be nice to be able to collapse/expand the tree view of subprocesses based on the parent PID. We have some PID's with hundreds of subprocesses and it would really clean stuff up when searching (i realize there are search and filter functions but sometimes you dont know what you are looking for).

Thanks,

Sean

Sum of columns

I'm using the current git of htop and I think it would be nice if we would have an option that shows the sum of all columns that are summable. For example with such an option it would be easy to see the total memory processes are using/sharing.

Option for the delay in the interface

I'm using the current git of htop and in the htoprc it is possible to adjust the resfresh rate with the delay key. Maybe htop could also have an option in its graphical interface to change this value.

not showing pagefaults stats

columns minflt majflt cminflt cmajflt show as dashes '-' in table title and values.

(tested 1.0.1, 1.0.2, master, ubuntu/slackware - i can see pagefaults stats in top, sar or collectl)

Freebsd native usage

How about a FreeBSD Native htop version? Without the need for linprocfs?
Because i discovered the problem that htop doesn't display wired memory usage in FreeBSD and therefore only shows a much lower, and therefore wrong, memory usage compared to top or vmstat (vmstat -m)

Tree-view child process username not visible

When using tree-view the username for child processes color is black and thus not visible (background is also black), unless you've actively selected the child process row. See attached screenshot.

screen shot 2014-03-31 at 7 26 06 pm

./configure script?

Apologies for my being naive: there seems to be no configure scripts or makefiles in this repo? Thus how should one compile it?

Cheers,
Yannick

Feature: make alternate menu like in mc

Currently there is only 1 menu, which is full. It would be nice if by holding ctrl or such you could switch to another menu that would offer other stuff that doesn't fit into current 12 function keys.

For example it would be cool if ctrl + left / right arrow would quickly let you switch the column by which the list is sorted so that you could very quickly switch the view's and simply change if you want sort processes by memory, or IO etc, that is something I am really missing now (having to switch the columns by accessing the preferences is just slow)

Old tickets on SourceForge

The tickets on SourceForge aren't accessable anymore and they aren't ported to this tracker. At least I had still 11 unresolved tickets so it is likely that there are much more. Maybe you could port all unresolved tickets to this tracker or maybe you can enable the read access on SourceForge again so I can revalidate my tickets and port them myself if needed.

Optionally hide Function Bar

Really enjoy using htop. Would be great if there was an option to disable the Function Bar though as it takes up valuable screen space on a smaller screen. I'll see if I can work this out.

VIRT column doesn't go over 127T

I'm using the current git of htop and have noticed that the VIRT column is capped at 127T but the virtual memory of a process can go even higher.

Processes are not followed correctly

I'm using the current git of htop and on pressing F5 to enable the tree view the focus stays always on the same line (which is mostly not the same process) instead of following the correct process.

crash

$ htop

htop 1.0.2 aborting. Please report bug at http://htop.sf.net

Please include in your report the following backtrace:
htop[0x40ae3f]
/lib64/libc.so.6(+0x38540)[0x7f5888e44540]
htop(Panel_draw+0x2b6)[0x40fcb6]
htop(main+0x7a9)[0x406e69]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f5888e30bf5]
htop[0x4092a5]

Additionally, in order to make the above backtrace useful,
please also run the following command to generate a disassembly of your binary:

objdump -d which htop > ~/htop.objdump

and then attach the file ~/htop.objdump to your bug report.

Thank you for helping to improve htop!

Aborted

Wrong value for CPU%

Since upgrade to 3.12.8-hardened kernel, when i open htop as user the cpu% displays 100% for every process. 3.12.6-hardened and before worked fine. top works, looks like a mistake inside htop.

Command name of zombie processes are cut

I'm using the current git of htop and zombie process are not fully displayed with their correct names/arguments. This can be tested on executing dash -c '(sleep 1 & sleep 10)' as after 1 second the first sleep process will turn into a zombie process and its argument will be cut.

Sum of cpu usage

I'm using the current git of htop and am missing the ability to see easily the real cpu usage of a core/on average in the cpu meter. For example a core can have its cpu time on userspace, kernelspace, etc. but to get the real cpu usage I have to add up these values. Maybe htop can show as first or last row a sum of these values.

htop aborted when pressing "k" during an empty filter

I set up a process filter, killed the only process matching the filter, and then pressed "k" again. To my surprise, htop core dumped. I tried it again and again, and it happened every time. I'm guessing this bug is caused by a missing check that there is actually a process currently selected.

The output is:

htop 1.0.1 aborting. Please report bug at http://htop.sf.net
Backtrace: 
htop[0x407d3f]
/lib64/libc.so.6[0x3303a32ac0]
htop(main+0x1e7e)[0x40b2ce]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x3303a1ec9d]
htop[0x404f89]
[1]    28568 abort (core dumped)  htop

Calculating only visible processes

I'm using the current git of htop and if many processes are spawned htop does also calculate them if they are not visible. Maybe htop can optimize this behavior and firstly calculate which processes are visible in the current environment and then processing only these processes. I think this could be really difficult (if not imposibble) on some sortings as they have to check normally all processes but maybe it is possible to do this on simple sortings like on PID.

[Mac] Crashes in OSX 10.9 when in full screen

When I try to use htop while in terminal/ iterm full screen mode, the application crashes.

This happens both if I launch while in fullscreen and also if I transition to fullscreen after launching:

htop 0.8.2.2 aborted. Please report bug at http://htop.sf.net

patch for display program basename (misplaced in conversion shuffle)

[[copy of earlier email to another mailing list]]

Hi.

It looks like the ticket creation is limited on SourceForge for htop (I could not create a feature request ticket or patch ticket), so I'm sending this patch to this mailing list [htop-general]. I hope you find it useful.

It provides the "display_base_name" feature, which will display the program basename if enabled.

FYI. /J
From c801f276ec55baccaa8ffb3abe5875ccbc3ed8ae Mon Sep 17 00:00:00 2001
From: Jskud [email protected]
Date: Sun, 12 Jan 2014 11:55:07 -0800
Subject: [PATCH 1/1] add display_base_name support

Signed-off-by: Jskud [email protected]

DisplayOptionsPanel.c | 1 +
Process.c | 9 ++++++++-
ProcessList.c | 2 ++
ProcessList.h | 1 +
Settings.c | 3 +++
5 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/DisplayOptionsPanel.c b/DisplayOptionsPanel.c
index 6153313..0feb665 100644
--- a/DisplayOptionsPanel.c
+++ b/DisplayOptionsPanel.c
@@ -84,6 +84,7 @@ DisplayOptionsPanel* DisplayOptionsPanel_new(Settings* settings, ScreenManager*
Panel_add(super, (Object_) CheckItem_new(strdup("Hide userland threads"), &(settings->pl->hideUserlandThreads), false));
Panel_add(super, (Object_) CheckItem_new(strdup("Display threads in a different color"), &(settings->pl->highlightThreads), false));
Panel_add(super, (Object*) CheckItem_new(strdup("Show custom thread names"), &(settings->pl->showThreadNames), false));

  • Panel_add(super, (Object_) CheckItem_new(strdup("Display program "basename""), &(settings->pl->displayBaseName), false));
    Panel_add(super, (Object_) CheckItem_new(strdup("Highlight program "basename""), &(settings->pl->highlightBaseName), false));
    Panel_add(super, (Object_) CheckItem_new(strdup("Highlight large numbers in memory counters"), &(settings->pl->highlightMegabytes), false));
    Panel_add(super, (Object_) CheckItem_new(strdup("Leave a margin around header"), &(settings->header->margin), false));
    diff --git a/Process.c b/Process.c
    index 6765be7..4a39557 100644
    --- a/Process.c
    +++ b/Process.c
    @@ -369,8 +369,15 @@ static void Process_printTime(RichString* str, unsigned long long t) {
    }

static inline void Process_writeCommand(Process* this, int attr, int baseattr, RichString* str) {

  • char *cmdstring = this->comm;
  • if (this->pl->displayBaseName) {
  •  for (char *cp = this->comm; *cp; cp++) {
    
  • if (*cp == ' ') break;
  • if (*cp == '/') cmdstring = cp+1;
  •  }
    
  • }
    int start = RichString_size(str);
  • RichString_append(str, attr, this->comm);
  • RichString_append(str, attr, cmdstring);
    if (this->pl->highlightBaseName) {
    int finish = RichString_size(str) - 1;
    int space = RichString_findChar(str, ' ', start);
    diff --git a/ProcessList.c b/ProcessList.c
    index a0aed39..7d71fcf 100644
    --- a/ProcessList.c
    +++ b/ProcessList.c
    @@ -144,6 +144,7 @@ typedef struct ProcessList_ {
    bool hideKernelThreads;
    bool hideUserlandThreads;
    bool treeView;
  • bool displayBaseName;
    bool highlightBaseName;
    bool highlightMegabytes;
    bool highlightThreads;
    @@ -251,6 +252,7 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList) {
    this->hideKernelThreads = false;
    this->hideUserlandThreads = false;
    this->treeView = false;
  • this->displayBaseName = false;
    this->highlightBaseName = false;
    this->highlightMegabytes = false;
    this->detailedCPUTime = false;
    diff --git a/ProcessList.h b/ProcessList.h
    index cabd68d..5d934fa 100644
    --- a/ProcessList.h
    +++ b/ProcessList.h
    @@ -124,6 +124,7 @@ typedef struct ProcessList_ {
    bool hideKernelThreads;
    bool hideUserlandThreads;
    bool treeView;
  • bool displayBaseName;
    bool highlightBaseName;
    bool highlightMegabytes;
    bool highlightThreads;
    diff --git a/Settings.c b/Settings.c
    index 0a85d58..977596f 100644
    --- a/Settings.c
    +++ b/Settings.c
    @@ -111,6 +111,8 @@ static bool Settings_read(Settings* this, char* fileName, int cpuCount) {
    this->pl->shadowOtherUsers = atoi(option[1]);
    } else if (String_eq(option[0], "show_thread_names")) {
    this->pl->showThreadNames = atoi(option[1]);
  •  } else if (String_eq(option[0], "display_base_name")) {
    
  •     this->pl->displayBaseName = atoi(option[1]);
    
    } else if (String_eq(option[0], "highlight_base_name")) {
    this->pl->highlightBaseName = atoi(option[1]);
    } else if (String_eq(option[0], "highlight_megabytes")) {
    @@ -182,6 +184,7 @@ bool Settings_write(Settings* this) {
    fprintf(fd, "hide_userland_threads=%d\n", (int) this->pl->hideUserlandThreads);
    fprintf(fd, "shadow_other_users=%d\n", (int) this->pl->shadowOtherUsers);
    fprintf(fd, "show_thread_names=%d\n", (int) this->pl->showThreadNames);
  • fprintf(fd, "display_base_name=%d\n", (int) this->pl->displayBaseName);
    fprintf(fd, "highlight_base_name=%d\n", (int) this->pl->highlightBaseName);
    fprintf(fd, "highlight_megabytes=%d\n", (int) this->pl->highlightMegabytes);
    fprintf(fd, "highlight_threads=%d\n", (int) this->pl->highlightThreads);
    --
    1.8.1.2

crash (very similar to #13)

Happened upon trying to enable "Detailed CPU time" after having added "CPU average" to the right column as text. Enabling "Detailed.." first and adding "CPU average" afterwards works.


htop 1.0.2 aborting. Please report bug at http://htop.sf.net

Please include in your report the following backtrace:
htop[0x4098e7]
/lib/x86_64-linux-gnu/libc.so.6(+0x36ff0)[0x7fe993216ff0]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x3c)[0x7fe993263c6c]
htop[0x41142b]
htop(ProcessList_scan+0x4cc)[0x41238c]
htop(ScreenManager_run+0x242)[0x4134b2]
htop(main+0x21c9)[0x407629]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7fe993201ec5]
htop[0x407daf]
...
Aborted (core dumped)

Trying to upload the objdump - the system seems to accept images only

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.