aboutsummaryrefslogtreecommitdiff
path: root/share/man/man4/lindebugfs.4
blob: 25a398a93f2224e0319fa694a78e363063a51cbe (plain) (blame)
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
.\"  SPDX-License-Identifier: BSD-2-Clause
.\"
.\"  Copyright (c) 2022, Jake Freeland <jfree@freebsd.org>
.\"
.\"  Redistribution and use in source and binary forms, with or without
.\"  modification, are permitted provided that the following conditions
.\"  are met:
.\"  1. Redistributions of source code must retain the above copyright
.\"     notice, this list of conditions and the following disclaimer.
.\"  2. Redistributions in binary form must reproduce the above copyright
.\"     notice, this list of conditions and the following disclaimer in the
.\"     documentation and/or other materials provided with the distribution.
.\"
.\"  THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\"  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\"  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\"  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\"  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\"  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\"  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\"  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\"  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\"  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\"  SUCH DAMAGE.

.Dd August 10, 2022
.Dt LINDEBUGFS 4
.Os
.Sh NAME
.Nm lindebugfs
.Nd Linux file system for debugging
.Sh SYNOPSIS
.Bd -literal
lindebugfs		/sys/kernel/debug	lindebugfs	rw 0 0
.Ed
.Sh DESCRIPTION
The debug file system, or debugfs, makes process debugging easier by
providing a simple API for data transfer between the kernel and user
space.
Debugfs is not a general-purpose file system and should not be used as
a storage medium.
Instead, developers can implement the debugfs interface in their code
to generate debug information about their program at runtime.
FreeBSD's
.Nm
uses the
.Xr pseudofs 9
file system construction kit to model itself after Linux's debugfs.
The
.Nm
API is intended for use with programs that take advantage of FreeBSD's
LinuxKPI compatibility layer.
.Pp
When mounted,
.Nm
will populate with pseudo files from any running process that calls
.Nm debugfs_create_file() .
Since
.Nm
is a pseudo file system, file contents will be generated dynamically
based on program provided file operations.
The current
.Nm
implementation formally supports seq_file and simple_attr_file virtual
file formats.
.Sh EXAMPLES
Load the
.Nm
kernel module:
.Pp
.Dl "kldload lindebugfs"
.Pp
Mount the
.Nm
file system on
.Pa /sys/kernel/debug :
.Pp
.Dl "mount -t lindebugfs lindebugfs /sys/kernel/debug"
.Sh SEE ALSO
.Xr linprocfs 4 ,
.Xr linsysfs 4 ,
.Xr pseudofs 9 ,
.Xr linux 4 ,
.Xr mount 1
.Sh HISTORY
The
.Nm
file system first appeared in
.Fx 12.1 .
.Sh AUTHORS
.An -nosplit
The initial implementation for
.Nm
was created by Matthew Macy.
This manual page was written by Jake Freeland.