~nabijaczleweli/febug

ref: a6632a3b97a3d6f5464bb2662be3ebb516301203 febug/man/febug.8 -rw-r--r-- 3.5 KiB
a6632a3bнаб Show long options in usage. Align febug_message member names in febug-abi.5. Proof manual 9 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
.\"" SPDX-License-Identifier: MIT
.Dd FEBUG_DATE
.Dt FEBUG 8
.Os
.Sh NAME
.Nm febug
.Nd User-space debugfs filesystem driver
.\""
.Sh SYNOPSIS
.Nm
.Op Fl h Ns \&| Fl -help
.Op Fl V Ns \&| Fl -version
.Op Fl d
#if __NetBSD__
.Op Ar "librefuse options"
#else
.Op Ar "libfuse options"
#endif
.Ar mountpoint
.
.Sh DESCRIPTION
Mounts a filesystem at
.Ar mountpoint
that allows programs to register themselves and expose variables to be (relatively) non-intrusively inspected at run-time, inspired by
#if __linux__
the
#else
Linux's
#endif
.Lk https://www.kernel.org/doc/html/latest/filesystems/debugfs.html "debugfs"
filesystem.
.Pp
See
.Xr febug-abi 8
for implementation details, and the
.Sx EXAMPLES
section for an example debug session.
.Sh OPTIONS
.Fl h , -help
and
.Fl V , -version
are self-explanatory.
.Pp
.Fl d
enables debug output from both
.Nm
and
#if __NetBSD__
.Nm librefuse .
#else
.Nm libfuse .
#endif
.Pp
.Nm
passes all arguments
.Pq which have to, therefore, include Ar mountpoint
to
.Xr fuse_main 3 ,
with
.Fl f
(foreground) and
.Fl o Cm default_permissions
appended.
If run with effective UID of
.Sy 0 ,
it also appends
.Fl o Cm allow_other .
.Sh ENVIRONMENT
.Bl -tag -compact -width "FEBUG_SOCKET"
.It Ev FEBUG_SOCKET
the socket at which to listen for programs, or
#if __linux__
.Pa /run/febug.sock
#else
.Pa /var/run/febug.sock
#endif
by default.
.El
.Sh EXAMPLES
.Bd -literal
#if __linux__
#define FEBUGDIR /run/febug
#else
#define FEBUGDIR /var/run/febug
#endif
#if __linux__
.Li # Nm systemctl Cm start Li febug
#elif __OpenBSD__
.Li # Nm rcctl Cm start Li febug
#elif __APPLE__
.Li # Nm launchctl Cm start Li xyz.nabijaczleweli.febug
#else
.Li # Nm service Li febug Cm start
#endif
#if __linux__
.Li $ Nm findmnt Li FEBUGDIR
FEBUGDIR febug  fuse.febug rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other
#else
.Li $ Nm mount No \&| Nm grep Li febug
#if __FreeBSD__
/dev/fuse on FEBUGDIR (fusefs)
#elif __OpenBSD__
fusefs on FEBUGDIR type fuse (local)
#elif __NetBSD__
/dev/puffs on FEBUGDIR type puffs|refuse:febug (nodev, nosuid)
#elif __APPLE__
#define STITCH_(a, b) a##b
#define STITCH(a, b) STITCH_(a, b)
.\"" fun fact: this isn't technically legal, and -Wno-invalid-token-paste is supposed to mask this, but it doesn't
febug@macfuse0 on STITCH(/private, FEBUGDIR) (macfuse, synchronous)
#else
#error Unknown platform!
Unknown platform!
#endif
#endif
.Li $ Nm ./out/examples/vector-sort Li &
[1] 1409
.Li $ Ev LD_LIBRARY_PATH Ns Li = Ns Pa out Nm ./out/examples/string-qsort Li &
[2] 1410
.Li $ Nm ls Pa FEBUGDIR/
1409    1410
.Li $ Nm ls Fl l Pa FEBUGDIR/
dr-xr-x--- 4 nabijaczleweli users 0 Jan 15 19:52 1409
dr-xr-x--- 3 nabijaczleweli users 0 Jan 15 19:52 1410
.Li $ Nm ls Pa FEBUGDIR/1409/
comparisons     cool_data
.Li $ Nm cat Pa FEBUGDIR/1409/\&*
24
-3 -2 -3 -2 -3 -2 3 -1 -2 -3 0 1 2 3 -1 -2 -3 0 1 2 3 -1 -2 -3 0 1 2 3 -1 2 1 0 1 2 3 -1 0 -1 0 1 2 3
.Li $ Nm cat Pa FEBUGDIR/1409/\&*
45
-3 -2 -3 -2 -3 -2 -3 -2 -2 -3 -3 -2 -1 3 -1 1 0 0 1 2 3 2 -1 3 0 1 2 3 -1 2 1 0 1 2 3 -1 0 -1 0 1 2 3
.Li $ Nm grep Li \&. Pa FEBUGDIR/\&*/\&*
FEBUGDIR/1409/comparisons:71
FEBUGDIR/1409/cool_data:-3 -3 -3 -3 -3 -3 -2 -2 -2 -2 -2 -2 -1 3 -1 1 0 0 1 2 3 2 -1 3 0 1 2 3 -1 2 1 0 1 2 3 -1 0 -1 0 1 2 3
FEBUGDIR/1410/cool_data:3012987654ACEFOLJKODNIEMIGHBPPbdWwnfTpXQcreRlVvUSitZQWjRTYUazuqwertyuiopoxyhmYsgkq
.Li $ Nm kill Ar %1
.Li $ Nm ls Pa FEBUGDIR/
1410
.Ed
.Sh SEE ALSO
.Xr febug-abi 5
\(em the ABI used to connect with this filesystem.
.Pp
.Xr libfebug 3 ,
.Xr libfebug++ 3 ,
.Xr libfebug.rs 3
\(em libraries wrapping said ABI.
.
#include "footer.h"