summaryrefslogtreecommitdiffstats
path: root/extras/vpp_stats_fs/README.md
diff options
context:
space:
mode:
authorArthur de Kerhor <arthurdekerhor@gmail.com>2021-03-03 08:49:15 -0800
committerDave Barach <openvpp@barachs.net>2021-03-24 12:16:43 +0000
commit1f13f8fd8a5f5f68e6e03825115c64383f17a1b5 (patch)
tree966eb8209ed495c3a544aeaa32f223f5e67214ae /extras/vpp_stats_fs/README.md
parent4d2726ece83f391a7cadb1314415ef23104f9ffe (diff)
misc: fuse fs for the stats segment
This extra allows to mount a FUSE filesystem reflecting the state of the stats segment. Type: feature Signed-off-by: Arthur de Kerhor <arthurdekerhor@gmail.com> Change-Id: I692f9ca5a65c1123b3cf28c761455eec36049791
Diffstat (limited to 'extras/vpp_stats_fs/README.md')
-rwxr-xr-xextras/vpp_stats_fs/README.md61
1 files changed, 61 insertions, 0 deletions
diff --git a/extras/vpp_stats_fs/README.md b/extras/vpp_stats_fs/README.md
new file mode 100755
index 00000000000..3b0b09468a6
--- /dev/null
+++ b/extras/vpp_stats_fs/README.md
@@ -0,0 +1,61 @@
+# VPP stats segment FUSE filesystem
+
+The statfs binary allows to create a FUSE filesystem to expose and to browse the stats segment.
+Is is leaned on the Go-FUSE library and requires Go-VPP stats bindings to work.
+
+The binary mounts a filesystem on the local machine whith the data from the stats segments.
+The counters can be opened and read as files (e.g. in a Unix shell).
+Note that the value of a counter is determined when the corresponding file is opened (as for /proc/interrupts).
+
+Directories regularly update their contents so that new counters get added to the filesystem.
+
+## Prerequisites (for building)
+
+**GoVPP** library (master branch)
+**Go-FUSE** library
+vpp, vppapi
+
+## Building
+
+Here, we add the Go librairies before building the binary
+```bash
+go mod init stats_fs
+go get git.fd.io/govpp.git@master
+go get git.fd.io/govpp.git/adapter/statsclient@master
+go get github.com/hanwen/go-fuse/v2
+go build
+```
+
+## Usage
+
+The basic usage is:
+```bash
+sudo ./statfs <MOUNT_POINT> &
+```
+**Options:**
+ - debug \<true|false\> (default is false)
+ - socket \<statSocket\> (default is /run/vpp/stats.sock)
+
+## Browsing the filesystem
+
+You can browse the filesystem as a regular user.
+Example:
+
+```bash
+cd /path/to/mountpoint
+cd sys/node
+ls -al
+cat names
+```
+
+## Unmounting the file system
+
+You can unmount the filesystem with the fusermount command.
+```bash
+sudo fusermount -u /path/to/mountpoint
+```
+
+To force the unmount even if the resource is busy, add the -z option:
+```bash
+sudo fusermount -uz /path/to/mountpoint
+``` \ No newline at end of file