Giter Club home page Giter Club logo

inotify-info's Introduction

inotify-info

Easily track down the number of inotify watches, instances, and which files are being watched.

The Linux inotify system has a few issues 12 and it can be difficult to debug when you for instance run out of watches. Using this app should hopefully aid you in tracking down how many inotify watches, instances, and what files are being watched.

Screenshot

Alt text

Build

$ make
Building _release/inotify-info...
---- inotify-info.cpp ----
---- lfqueue/lfqueue.c ----
Linking _release/inotify-info...
$ CFG=debug make
Building _debug/inotify-info...
---- inotify-info.cpp ----
---- lfqueue/lfqueue.c ----
Linking _debug/inotify-info...

Or you can build Docker image.

docker build . -t inotify-info

Install

You are free to copy the resulting executable to any suitable location in your $PATH.

cp _release/inotify-info /usr/local/bin/

Run (Prints Summary)

$ _release/inotify-info 
------------------------------------------------------------------------------
INotify Limits:
  max_queued_events:  16384
  max_user_instances: 128
  max_user_watches:   65536
------------------------------------------------------------------------------
     Pid  App                        Watches   Instances
     2632 systemd                         23   3
     2653 pulseaudio                       2   2
     2656 dbus-daemon                      2   1
     2987 dbus-daemon                      1   1
     3056 xfsettingsd                     56   1
     3068 xfdesktop                       10   1
     3072 wrapper-2.0                      6   1
     3091 xfce4-clipman                    1   1
     3099 xiccd                            1   1
     3343 xfce4-terminal                   1   1
     3997 xfce4-appfinder                 11   1
     4048 xdg-desktop-portal               1   1
     4086 xdg-desktop-portal-gtk          56   1
   205668 vivaldi-bin                      8   1
   205705 vivaldi-bin                      2   1
------------------------------------------------------------------------------
Total inotify Watches:   181
Total inotify Instances: 18
------------------------------------------------------------------------------

Run with Appname Filter

$ _release/inotify-info xfce4
------------------------------------------------------------------------------
INotify Limits:
  max_queued_events:  16384
  max_user_instances: 128
  max_user_watches:   65536
------------------------------------------------------------------------------
     Pid  App                        Watches   Instances
     2632 systemd                         23   3
     2653 pulseaudio                       2   2
     2656 dbus-daemon                      2   1
     2987 dbus-daemon                      1   1
     3056 xfsettingsd                     56   1
     3068 xfdesktop                       10   1
     3072 wrapper-2.0                      6   1
     3091 xfce4-clipman                    1   1
      94111050 [10304h]
     3099 xiccd                            1   1
     3343 xfce4-terminal                   1   1
      71048655 [10304h]
     3997 xfce4-appfinder                 11   1
      94111468 [10304h]  15339430 [10304h]  14554799 [10304h]  70254617 [10304h]  70254684 [10304h]  16786993 [10304h]  14551253 [10304h]  14550430 [10304h]  70254647 [10304h]  70254646 [10304h]
      92275589 [10304h]
     4048 xdg-desktop-portal               1   1
     4086 xdg-desktop-portal-gtk          56   1
   205668 vivaldi-bin                      8   1
   205705 vivaldi-bin                      2   1
------------------------------------------------------------------------------
Total inotify Watches:   181
Total inotify Instances: 18
------------------------------------------------------------------------------

Searching '/' for listed inodes... (8 threads)
 14550430 [10304h] /usr/share/applications/
 14551253 [10304h] /usr/local/share/
 14554799 [10304h] /usr/share/xfce4/
 15339430 [10304h] /usr/share/desktop-directories/
 16786993 [10304h] /usr/share/xfce4/applications/
 70254617 [10304h] /home/mikesart/.local/share/
 70254646 [10304h] /home/mikesart/.config/menus/
 70254647 [10304h] /home/mikesart/.config/menus/applications-merged/
 70254684 [10304h] /home/mikesart/.local/share/applications/
 71048655 [10304h] /home/mikesart/.config/xfce4/terminal/
 92275589 [10304h] /etc/xdg/menus/
 94111050 [10304h] /home/mikesart/.config/xfce4/panel/
 94111468 [10304h] /home/mikesart/.cache/xfce4/xfce4-appfinder/

Run with Specific Pid(s)

$ _release/inotify-info 3997
------------------------------------------------------------------------------
INotify Limits:
  max_queued_events:  16384
  max_user_instances: 128
  max_user_watches:   65536
------------------------------------------------------------------------------
     Pid  App                        Watches   Instances
     2632 systemd                         23   3
     2653 pulseaudio                       2   2
     2656 dbus-daemon                      2   1
     2987 dbus-daemon                      1   1
     3056 xfsettingsd                     56   1
     3068 xfdesktop                       10   1
     3072 wrapper-2.0                      6   1
     3091 xfce4-clipman                    1   1
     3099 xiccd                            1   1
     3343 xfce4-terminal                   1   1
     3997 xfce4-appfinder                 11   1
      94111468 [10304h]  15339430 [10304h]  14554799 [10304h]  70254617 [10304h]  70254684 [10304h]  16786993 [10304h]  14551253 [10304h]  14550430 [10304h]  70254647 [10304h]  70254646 [10304h]
      92275589 [10304h]
     4048 xdg-desktop-portal               1   1
     4086 xdg-desktop-portal-gtk          56   1
   205668 vivaldi-bin                      8   1
   205705 vivaldi-bin                      2   1
------------------------------------------------------------------------------
Total inotify Watches:   181
Total inotify Instances: 18
------------------------------------------------------------------------------

Searching '/' for listed inodes... (8 threads)
 14550430 [10304h] /usr/share/applications/
 14551253 [10304h] /usr/local/share/
 14554799 [10304h] /usr/share/xfce4/
 15339430 [10304h] /usr/share/desktop-directories/
 16786993 [10304h] /usr/share/xfce4/applications/
 70254617 [10304h] /home/mikesart/.local/share/
 70254646 [10304h] /home/mikesart/.config/menus/
 70254647 [10304h] /home/mikesart/.config/menus/applications-merged/
 70254684 [10304h] /home/mikesart/.local/share/applications/
 92275589 [10304h] /etc/xdg/menus/
 94111468 [10304h] /home/mikesart/.cache/xfce4/xfce4-appfinder/

Run on Docker

docker run --rm --privileged -v /proc:/proc inotify-info

Credits

lfqueue is BSD-2-Clause License

inotify-info's People

Contributors

mikesart avatar fatso83 avatar drok avatar grenewode avatar jlandowner avatar x-7 avatar

Watchers

 avatar

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.