xref: /netbsd-src/usr.sbin/perfused/perfused.8 (revision e2f2539cb1b8f435ff9c2aa8182ba6cb20b7c3de)
1*e2f2539cSgutteridge.\" $NetBSD: perfused.8,v 1.13 2019/07/06 00:45:02 gutteridge Exp $
2a18d4c5aSmanu.\"
3a18d4c5aSmanu.\" Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
4a18d4c5aSmanu.\"
5a18d4c5aSmanu.\" Redistribution and use in source and binary forms, with or without
6a18d4c5aSmanu.\" modification, are permitted provided that the following conditions
7a18d4c5aSmanu.\" are met:
8a18d4c5aSmanu.\" 1. Redistributions of source code must retain the above copyright
9a18d4c5aSmanu.\"    notice, this list of conditions and the following disclaimer.
10a18d4c5aSmanu.\" 2. Redistributions in binary form must reproduce the above copyright
11a18d4c5aSmanu.\"    notice, this list of conditions and the following disclaimer in the
12a18d4c5aSmanu.\"    documentation and/or other materials provided with the distribution.
13a18d4c5aSmanu.\"
14a18d4c5aSmanu.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
15a18d4c5aSmanu.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
16a18d4c5aSmanu.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17a18d4c5aSmanu.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
18a18d4c5aSmanu.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19a18d4c5aSmanu.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20a18d4c5aSmanu.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21a18d4c5aSmanu.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22a18d4c5aSmanu.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23a18d4c5aSmanu.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24a18d4c5aSmanu.\" POSSIBILITY OF SUCH DAMAGE.
25a18d4c5aSmanu.\"
26f4788d8fSwiz.Dd January 29, 2012
27a18d4c5aSmanu.Dt PERFUSED 8
281199515bSnjoly.Os
29a18d4c5aSmanu.Sh NAME
30a18d4c5aSmanu.Nm perfused
31cd9eb5b6Swiz.Nd PUFFS Enabled Relay to FUSE Daemon
32a18d4c5aSmanu.Sh SYNOPSIS
33a18d4c5aSmanu.Nm
34cd9eb5b6Swiz.Op Fl fs
35a18d4c5aSmanu.Op Fl d Ar types
3613260297Smanu.Op Fl i fd
37a18d4c5aSmanu.Sh DESCRIPTION
38a18d4c5aSmanu.Nm
39cd9eb5b6Swizis a userland daemon implementing the FUSE kernel level API.
40cd9eb5b6SwizIt creates a
41a18d4c5aSmanu.Pa /dev/fuse
42cd9eb5b6Swizsocket for FUSE file system daemons to connect to.
43a18d4c5aSmanu.Nm
44cd9eb5b6Swiztakes care of mounting the file system using
45a18d4c5aSmanu.Xr puffs 3 .
46a18d4c5aSmanu.Pp
47a18d4c5aSmanuWhen the kernel sends a
48a18d4c5aSmanu.Xr puffs 3
49a18d4c5aSmanuoperation for the mounted file system,
50a18d4c5aSmanu.Nm
51a18d4c5aSmanuwill translate it into a FUSE request, and will send it to the file system
52a18d4c5aSmanudaemon through
53a18d4c5aSmanu.Pa /dev/fuse .
54a18d4c5aSmanuThe FUSE reply will be converted back into a
55a18d4c5aSmanu.Xr puffs 3
56a18d4c5aSmanureply and will be relayed to the kernel.
57a18d4c5aSmanu.Pp
58cd9eb5b6SwizFUSE file system daemons must be modified so that they request
59a18d4c5aSmanu.Nm
60cd9eb5b6Swizto perform the
61a18d4c5aSmanu.Xr mount 2
62cd9eb5b6Swizsystem call instead of doing it on their own.
63cd9eb5b6SwizThis is done by replacing
64a18d4c5aSmanu.Xr mount 2
65a18d4c5aSmanuand the
66a18d4c5aSmanu.Xr open 2
67cd9eb5b6Swizcalls for
68a18d4c5aSmanu.Pa /dev/fuse
69cd9eb5b6Swizwith
70a18d4c5aSmanu.Fn perfuse_mount
71a18d4c5aSmanuand
72cd9eb5b6Swiz.Fn perfuse_open ,
73cd9eb5b6Swizrespectively, in their sources.
74a18d4c5aSmanu.Xr libperfuse 3
75a18d4c5aSmanumust be used at link time.
76a18d4c5aSmanuMost FUSE file system daemons use
77a18d4c5aSmanu.Nm libfuse
78cd9eb5b6Swizand will work unmodified, provided the modification is done in
79a18d4c5aSmanu.Nm libfuse
80a18d4c5aSmanuitself.
81a18d4c5aSmanu.Pp
82cd9eb5b6SwizThe following options are available:
83cd9eb5b6Swiz.Bl -tag -width XdXtypesXX
84a18d4c5aSmanu.It Fl d Ar types
85cd9eb5b6SwizPrint additional debug information.
86a18d4c5aSmanu.Ar types
87cd9eb5b6Swizis a comma-separated list of information types to print:
88a18d4c5aSmanu.Bl -tag -width indent
89a18d4c5aSmanu.It Ar puffs
90cd9eb5b6SwizDisplay PUFFS requests and replies.
91a18d4c5aSmanu.It Ar fuse
92cd9eb5b6SwizDisplay FUSE requests and replies.
93a18d4c5aSmanu.It Ar dump
94cd9eb5b6SwizDump content of FUSE frames.
95a18d4c5aSmanu.It Ar fh
96cd9eb5b6SwizDisplay file handle activity.
97a18d4c5aSmanu.It Ar reclaim
98cd9eb5b6SwizDisplay reclaim activity.
99a18d4c5aSmanu.It Ar readdir
100cd9eb5b6SwizDisplay readdir activity.
101a18d4c5aSmanu.It Ar requeue
102cd9eb5b6SwizDisplay requeue activity.
103516b1c90Smanu.It Ar sync
104cd9eb5b6SwizDisplay dirty flags and sync operations.
105a18d4c5aSmanu.El
106cd9eb5b6Swiz.It Fl f
107cd9eb5b6SwizDo not fork, but stay in the foreground.
10813260297Smanu.It Fl i Ar fd
10913260297SmanuDo not open
11013260297Smanu.Pa /dev/fuse
111cd9eb5b6Swizbut use the socket available from the file descriptor
11213260297Smanu.Ar fd .
11313260297SmanuThis is used when
11413260297Smanu.Nm
11513260297Smanuis started from
11613260297Smanu.Xr libperfuse 3 .
117cd9eb5b6Swiz.It Fl s
118cd9eb5b6SwizEnable debug output only when receiving
119cd9eb5b6Swiz.Li SIGINFO .
120a18d4c5aSmanu.El
121edb96218Smanu.Sh ENVIRONMENT
122edb96218SmanuSee
123edb96218Smanu.Xr libperfuse 3
124edb96218Smanufor environment variables affecting
125edb96218Smanu.Nm
126edb96218Smanubehavior.
1274fba06adSmanu.Sh SIGNALS
1284fba06adSmanu.Bl -tag -width indent
1298da35664Swiz.It Dv SIGINFO
1304fba06adSmanuIf the
1314fba06adSmanu.Fl s
1328da35664Swizflag was used, toggle debug output.
1338da35664SwizDo nothing otherwise.
1348da35664Swiz.It Dv SIGUSR1
135f4788d8fSwizToggle FUSE operation dump on and off.
136f4788d8fSwizWhen toggling off, the trace
1378fcbc707Smanuis is stored in
1388fcbc707Smanu.Pa /var/run/perfuse-xxx.trace
1398fcbc707Smanu(xxx is the filesystem mount point).
1404fba06adSmanu.El
141a18d4c5aSmanu.Sh ERRORS
142a18d4c5aSmanuThe program logs to the syslog daemon as facility
143a18d4c5aSmanu.Dq daemon .
144a18d4c5aSmanuFor detailed debugging use the
145a18d4c5aSmanu.Fl d
146a18d4c5aSmanu(debug) option.
147a18d4c5aSmanu.Sh SEE ALSO
148a18d4c5aSmanu.Xr mount 2 ,
149cd9eb5b6Swiz.Xr perfuse_mount 3 ,
150cd9eb5b6Swiz.Xr puffs 4
151a18d4c5aSmanu.Sh AUTHORS
152a18d4c5aSmanuThe program was written by
153a18d4c5aSmanu.An Emmanuel Dreyfus
154a18d4c5aSmanu.Aq manu@NetBSD.org .
1554486afd4Swiz.Sh BUGS
1564486afd4SwizWhen
1574486afd4Swiz.Nm
1584486afd4Swizruns in the foreground (using the
1594486afd4Swiz.Fl f
1604486afd4Swizflag), some processes using the FUSE file system will
161*e2f2539cSgutteridgesometimes hang on
1624486afd4Swiz.Sq uvn_fp2 .
163