{"id":14174818,"url":"https://github.com/ColinIanKing/health-check","last_synced_at":"2025-08-07T04:32:14.098Z","repository":{"id":33974015,"uuid":"37715023","full_name":"ColinIanKing/health-check","owner":"ColinIanKing","description":"The health-check tool monitors processes in various ways to help identify areas where it is consuming too many resources. One can trace one or more processes (including all their threads and child processes too) for a full story of system activity. ","archived":false,"fork":false,"pushed_at":"2024-01-19T16:04:35.000Z","size":750,"stargazers_count":34,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-20T01:34:34.732Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://kernel.ubuntu.com/~cking/health-check/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ColinIanKing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-06-19T10:00:32.000Z","updated_at":"2024-08-27T14:10:42.000Z","dependencies_parsed_at":"2024-01-19T15:37:13.518Z","dependency_job_id":"2fc35cd8-e8bb-4c21-9d8e-2fb526148b19","html_url":"https://github.com/ColinIanKing/health-check","commit_stats":null,"previous_names":[],"tags_count":87,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinIanKing%2Fhealth-check","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinIanKing%2Fhealth-check/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinIanKing%2Fhealth-check/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinIanKing%2Fhealth-check/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ColinIanKing","download_url":"https://codeload.github.com/ColinIanKing/health-check/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228994816,"owners_count":18003452,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-18T03:00:38.123Z","updated_at":"2024-12-10T02:30:42.703Z","avatar_url":"https://github.com/ColinIanKing.png","language":"C","funding_links":[],"categories":["Profiling"],"sub_categories":[],"readme":"# Health-check\n\nThe health-check tool monitors processes in various ways to help identify\nareas where it is consuming too many resources.  One can trace one or more\nprocesses (including all their threads and child processes too) for a full\nstory of system activity.\n\n## Health-check can monitor:\n* CPU usage\n* Kernel wake-up events\n* File I/O activity (open,read,write,close)\n* System call activity\n* Excessive polling of timeout wait blocked system calls (such as poll, select, etc)\n* Memory usage (such as heap and stack growth)\n* Network connections (to spot rogue internet activity)\n* Network usage (send/receive) accounting\n*  Syncing data via fsync, fdatasync, syncfs and sync system calls\n* Page fault accounting\n\n..and can also dump the stats into a JSON formatted file for later analysis.\n\n## Health-check command line options:\n\n* -b brief (simple mode) output\n* -c trace all child processes\n* -d duration of the test in seconds\n* -f follow fork/vfork/clone system calls\n* -h show help information\n* -p comma separated list of process IDs or process names to trace\n* -m maximum number of system calls to trace before stopping (default 1 million)\n* -o JSON output file\n* -r resolve IP addresses (may take a while to do)\n* -u run a command to trace as a specified user\n* -v verbose output\n* -w monitor wakelock counts (lightweight fnotify monitoring)\n* -W monitor wakelock usage (expensive syscall inspection overhead)\n\nHealth check can be used to either attach to one or more existing running\nprocesses using the -p option, or one can specify a command to be run and\nit will executed and traced. The latter option also allows one to specify\nthe user id to run the command under.\n\n## Example Output:\n```\nsudo health-check -p camera-app -c -d 60\nCPU usage:\n  PID  Process                USR%   SYS%  TOTAL%\n  3585 camera-app            18.97  16.93  35.90 (medium load)\n\nWakeups:\n  PID  Process               Wake/Sec Kernel Functions\n  3608 camera-app               13.62 (add_timer, OSTimerCallbackWrapper) (high)\n  3589 camera-app                3.17 (hrtimer_start_range_ns, hrtimer_wakeup) (moderate)\n  3608 camera-app                0.37 (schedule_timeout_uninterruptible, process_timeout) (low)\n  3585 camera-app                0.28 (hrtimer_start_range_ns, hrtimer_wakeup) (low)\n Total                          17.43\n\nContext Switches:\n  PID  Process                Voluntary   Involuntary     Total\n                             Ctxt Sw/Sec  Ctxt Sw/Sec  Ctxt Sw/Sec\n  3608 camera-app                1712.07       178.02      1890.09 (high)\n  3585 camera-app                1498.67        10.72      1509.39 (high)\n  3606 camera-app                 143.25        18.55       161.80 (quite high)\n  3667 camera-app                 142.33        18.68       161.02 (quite high)\n  3605 camera-app                 141.25        18.32       159.57 (quite high)\n  3628 camera-app                 128.12        16.50       144.62 (quite high)\n  3587 camera-app                 108.98         0.05       109.03 (quite high)\n  3661 camera-app                   6.48        46.30        52.78 (moderate)\n  3607 camera-app                  27.75         1.65        29.40 (moderate)\n  3589 camera-app                  20.48         0.02        20.50 (moderate)\n  3592 camera-app                   0.00         0.00         0.00 (idle)\n  3590 camera-app                   0.00         0.00         0.00 (idle)\n  3588 camera-app                   0.00         0.00         0.00 (idle)\n Total                           4238.19       308.80      3929.39\n\nFile I/O operations:\n  PID  Process               Count  Op  Filename\n  3585 camera-app               43    O /home/phablet/.config/user-dirs.dirs\n  3585 camera-app               41   CW /home/phablet/Pictures/image20130905_0004.jpg\n  3585 camera-app               22    W /tmp/Camera App.nS3585\n  3585 camera-app               21    C /home/phablet/.config/user-dirs.dirs\n  3585 camera-app               21    R /home/phablet/.config/user-dirs.dirs\n  3585 camera-app                1  OCR /home/phablet/.config/user-dirs.dirs\n Total                         149\n\nFile I/O Operations per second:\n  PID  Process                 Open   Close    Read   Write\n  3585 camera-app              0.73    1.05    0.37    1.05\n\nSystem calls traced:\n  PID  Process              Syscall               Count    Rate/Sec\n  3608 camera-app           ioctl                 25035     417.2470\n  3585 camera-app           futex                 13713     228.5484\n  3608 camera-app           futex                 12382     206.3652\n  3585 camera-app           clock_gettime          9065     151.0823\n  3585 camera-app           poll                   6098     101.6326\n  3585 camera-app           read                   5929      98.8160\n  3608 camera-app           clock_gettime          2949      49.1497\n  3608 camera-app           mmap2                  2389      39.8164\n  3628 camera-app           ioctl                  1532      25.5332\n  3608 camera-app           poll                   1421      23.6832\n  3608 camera-app           munmap                 1022      17.0332\n  3587 camera-app           epoll_wait              927      15.4499\n  3587 camera-app           recvfrom                926      15.4332\n  3585 camera-app           stat64                  682      11.3666\n  3628 camera-app           getpriority             409       6.8166\n  3585 camera-app           recvmsg                 396       6.6000\n  3585 camera-app           gettimeofday            319       5.3166\n  3628 camera-app           munmap                  279       4.6500\n  3585 camera-app           sendmsg                 242       4.0333\n  3589 camera-app           futex                   231       3.8500\n  3589 camera-app           nanosleep               190       3.1666\n  3628 camera-app           clock_gettime           155       2.5833\n  3585 camera-app           ioctl                    96       1.6000\n  3585 camera-app           fstat64                  88       1.4667\n  3628 camera-app           futex                    84       1.4000\n  3608 camera-app           read                     82       1.3667\n  3608 camera-app           open                     44       0.7333\n  3661 camera-app           futex                    30       0.5000\n  3585 camera-app           munmap                   24       0.4000\n  3661 camera-app           poll                     23       0.3833\n  3661 camera-app           read                     23       0.3833\n  3661 camera-app           clock_gettime            23       0.3833\n  3585 camera-app           fcntl64                  22       0.3667\n  3608 camera-app           writev                   22       0.3667\n  3585 camera-app           access                   22       0.3667\n  3585 camera-app           open                     22       0.3667\n  3661 camera-app           mmap2                    22       0.3667\n  3585 camera-app           fork                     21       0.3500\n  3587 camera-app           mprotect                 18       0.3000\n  3587 camera-app           futex                    12       0.2000\n  3628 camera-app           dup                      10       0.1667\n  3628 camera-app           _llseek                   5       0.0833\n  3628 camera-app           fcntl64                   5       0.0833\n  3628 camera-app           stat64                    5       0.0833\n  3628 camera-app           mmap2                     5       0.0833\n  3628 camera-app           fstat64                   5       0.0833\n  3628 camera-app           lstat64                   5       0.0833\n  3628 camera-app           rename                    5       0.0833\n  3628 camera-app           open                      5       0.0833\n  3628 camera-app           unlink                    5       0.0833\n  3661 camera-app           munmap                    1       0.0167\n  3661 camera-app           restart_syscall           1       0.0167\n  3592 camera-app           restart_syscall           1       0.0167\n  3585 camera-app           restart_syscall           1       0.0167\n Total                                            87028    1450.4563\n\nTop polling system calls:\n  PID  Process              Syscall             Rate/Sec   Infinite   Zero     Minimum    Maximum    Average\n                                                           Timeouts Timeouts   Timeout    Timeout    Timeout\n  3585 camera-app           poll                  101.6326     2974     1853   0.0 sec   25.0 sec  788.5 msec\n  3608 camera-app           poll                   23.6832        0     1421   0.0 sec    0.0 sec    0.0 sec\n  3587 camera-app           epoll_wait             15.4499        0        0   5.0 sec    5.0 sec    5.0 sec\n  3589 camera-app           nanosleep               3.1666        0        0 900.0 usec 900.0 usec 900.0 usec\n  3661 camera-app           poll                    0.3833       22        1   0.0 sec    0.0 sec    0.0 sec\n Total                                            144.3156     2996     3275\n\nDistribution of poll timeout times:\n                                                            10.0  100.0    1.0   10.0  100.0    1.0   10.0  100.0\n                                                    up to    to     to     to     to     to     to     to  or more\n                                              Zero    9.9   99.9  999.9    9.9   99.9  999.9    9.9   99.9        Infinite\n  PID  Process              Syscall            sec   usec   usec   usec   msec   msec   msec    sec    sec    sec   Wait\n  3585 camera-app           poll              1853     -      -      -      29    178    864     24    176     -    2974\n  3608 camera-app           poll              1421     -      -      -      -      -      -      -      -      -       0\n  3587 camera-app           epoll_wait           0     -      -      -      -      -      -     927     -      -       0\n  3589 camera-app           nanosleep            0     -      -     190     -      -      -      -      -      -       0\n  3661 camera-app           poll                 1     -      -      -      -      -      -      -      -      -      22\n\nPolling system call analysis:\n camera-app (3585), poll:\n          2 immediate timed out calls with zero timeout (non-blocking peeks)\n camera-app (3608), poll:\n       1339 immediate timed out calls with zero timeout (non-blocking peeks)\n       1297 repeated immediate timed out polled calls with zero timeouts (heavy polling peeks)\nPolling system call analysis:\n camera-app (3585), poll:\n          2 immediate timed out calls with zero timeout (non-blocking peeks)\n camera-app (3608), poll:\n       1339 immediate timed out calls with zero timeout (non-blocking peeks)\n       1297 repeated immediate timed out polled calls with zero timeouts (heavy polling peeks)\n\nPer Process Memory (K):\n  PID  Process              Type        Size       RSS       PSS\n  3585 camera-app           Stack        136        64        64\n  3585 camera-app           Heap      130440     11476     11476\n  3585 camera-app           Mapped    131308     44688     24811\n\nChange in memory (K/second):\n  PID  Process              Type        Size       RSS       PSS\n  3585 camera-app           Heap        0.00      1.80      1.80 (growing)\n  3585 camera-app           Mapped      0.00      0.40      0.37 (growing slowly)\n\nOpen Network Connections:\n None.\n```\n\n## Another example:\n\n```\nsudo health-check -u king dd if=/dev/zero of=test bs=1k count=100000\n100000+0 records in\n100000+0 records out\n102400000 bytes (102 MB) copied, 7.85756 s, 13.0 MB/s\nCPU usage (in terms of 1 CPU):\n  PID  Process                USR%   SYS% TOTAL%   Duration\n 22572 dd                     3.17  56.53  59.69       7.89  (high load)\n\nPage Faults:\n  PID  Process                 Minor/sec    Major/sec    Total/sec\n 22572 dd                          32.83         0.00        32.83\n\nWakeups:\n No wakeups detected.\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FColinIanKing%2Fhealth-check","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FColinIanKing%2Fhealth-check","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FColinIanKing%2Fhealth-check/lists"}