Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

process table format ugly when kernel.pid_max > 99999 #15

Closed
Zugschlus opened this issue Nov 17, 2017 · 1 comment
Closed

process table format ugly when kernel.pid_max > 99999 #15

Zugschlus opened this issue Nov 17, 2017 · 1 comment

Comments

@Zugschlus
Copy link
Contributor

This is me forwarding https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=850189

I run atop on a system where kernel.pid_max = 4194303.
Since all PIDs can be longer than 5 characters this leads to
an ugly jagged look in the process table once this happens:

   PID    TID  THR  SYSCPU USRCPU  VGROW   RGROW  RDDSK  WRDSK  ST EXC S  CPUNR  CPU CMD         1/6
1818110      -    1   0.12s  0.06s     0K      0K     0K     0K  --   - S      2   2% apps.plugin
1023550      -   10   0.02s  0.05s     0K      0K     0K     0K  --   - S      3   1% netdata
3885756      -   31   0.03s  0.01s     0K      0K     0K     0K  --   - S      0   0% mysqld
1023566      -    5   0.00s  0.04s     0K      0K     0K     0K  --   - S      3   0% python
1934013      -    1   0.03s  0.01s     0K      0K     0K     0K  --   - R      2   0% atop  
3950051      -    1   0.03s  0.01s     0K      0K     0K     0K  --   - S      0   0% gkrellmd
1917616      -    1   0.00s  0.02s     0K      0K     0K     0K  --   - S      0   0% bash
966886      -    1   0.00s  0.01s     0K      0K     0K     0K  --   - S      2   0% tor
303558      -   11   0.00s  0.01s     0K      0K     0K     0K  --   - S      1   0% syncthing
    38      -    1   0.01s  0.00s     0K      0K     0K     0K  --   - S      3   0% ksmd
1281656      -    7   0.00s  0.00s     0K      0K     0K     0K  --   - S      2   0% named
1167743      -    1   0.00s  0.00s     0K      0K     0K     0K  --   - S      2   0% php-fpm7.0
587618      -    7   0.00s  0.00s     0K      0K     0K     0K  --   - S      1   0% fail2ban-serve

This of course is only a minor cosmetic bug.
(To be fair, this is quite common upon tools displaying
PIDs, glances for example has the same problem.)

Thanks to Sven Hartge

@Atoptool
Copy link
Owner

Atoptool commented Jun 9, 2018

This issue has been solved already by reading /proc/sys/kernel/pid_max during startup of atop to determine the maximum number of digits. Atop adapts the column width of both PIDs and TIDs accordingly.

@Atoptool Atoptool closed this as completed Jun 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants