@@ -66,17 +66,17 @@ Package Manager
66
66
67
67
drgn can be installed using the package manager on some Linux distributions.
68
68
69
- .. image :: https://repology.org/badge/vertical-allrepos/drgn.svg
69
+ .. image :: https://repology.org/badge/vertical-allrepos/drgn.svg?exclude_unsupported=1
70
70
:target: https://repology.org/project/drgn/versions
71
71
:alt: Packaging Status
72
72
73
- * Fedora >= 32
73
+ * Fedora, RHEL/CentOS Stream >= 9
74
74
75
75
.. code-block :: console
76
76
77
77
$ sudo dnf install drgn
78
78
79
- * RHEL/CentOS >= 8
79
+ * RHEL/CentOS < 9
80
80
81
81
`Enable EPEL <https://docs.fedoraproject.org/en-US/epel/#_quickstart >`_. Then:
82
82
@@ -86,32 +86,35 @@ drgn can be installed using the package manager on some Linux distributions.
86
86
87
87
* Oracle Linux >= 8
88
88
89
- Enable the ``ol8_addons `` or ``ol9_addons `` repository and install drgn :
89
+ Enable the ``ol8_addons `` or ``ol9_addons `` repository. Then :
90
90
91
91
.. code-block :: console
92
92
93
93
$ sudo dnf config-manager --enable ol8_addons # OR: ol9_addons
94
94
$ sudo dnf install drgn
95
95
96
- Drgn is also available for Python versions in application streams. For
96
+ drgn is also available for Python versions in application streams. For
97
97
example, use ``dnf install python3.12-drgn `` to install drgn for Python 3.12.
98
98
See the documentation for drgn in `Oracle Linux 9
99
99
<https://docs.oracle.com/en/operating-systems/oracle-linux/9/drgn/how_to_install_drgn.html> `_
100
100
and `Oracle Linux 8
101
101
<https://docs.oracle.com/en/operating-systems/oracle-linux/8/drgn/how_to_install_drgn.html> `_
102
102
for more information.
103
103
104
- * Arch Linux
104
+ * Debian >= 12 (Bookworm)/Ubuntu >= 24.04 (Noble Numbat)
105
105
106
106
.. code-block :: console
107
107
108
- $ sudo pacman -S drgn
108
+ $ sudo apt install python3- drgn
109
109
110
- * Debian >= 12 (Bookworm)
110
+ To get the latest version on Ubuntu, enable the `michel-slm/kernel-utils PPA
111
+ <https://launchpad.net/~michel-slm/+archive/ubuntu/kernel-utils> `_ first.
112
+
113
+ * Arch Linux
111
114
112
115
.. code-block :: console
113
116
114
- $ sudo apt install python3- drgn
117
+ $ sudo pacman -S drgn
115
118
116
119
* Gentoo
117
120
@@ -125,15 +128,6 @@ drgn can be installed using the package manager on some Linux distributions.
125
128
126
129
$ sudo zypper install python3-drgn
127
130
128
- * Ubuntu
129
-
130
- Enable the `michel-slm/kernel-utils PPA <https://launchpad.net/~michel-slm/+archive/ubuntu/kernel-utils >`_.
131
- Then:
132
-
133
- .. code-block :: console
134
-
135
- $ sudo apt install python3-drgn
136
-
137
131
pip
138
132
^^^
139
133
@@ -152,27 +146,29 @@ This will install a binary wheel by default. If you get a build error, then pip
152
146
wasn't able to use the binary wheel. Install the dependencies listed `below
153
147
<#from-source> `_ and try again.
154
148
155
- Note that RHEL/CentOS 6, Debian Stretch, Ubuntu Trusty, and Ubuntu Xenial (and
156
- older) ship Python versions which are too old. Python 3.6 or newer must be
157
- installed.
149
+ Note that RHEL/CentOS 7, Debian 10 ("buster"), and Ubuntu 18.04 ("Bionic
150
+ Beaver") (and older) ship Python versions which are too old. Python 3.8 or
151
+ newer must be installed.
152
+
153
+ .. _installation-from-source :
158
154
159
155
From Source
160
156
^^^^^^^^^^^
161
157
162
158
To get the development version of drgn, you will need to build it from source.
163
159
First, install dependencies:
164
160
165
- * Fedora
161
+ * Fedora, RHEL/CentOS Stream >= 9
166
162
167
163
.. code-block :: console
168
164
169
- $ sudo dnf install autoconf automake check-devel elfutils-devel gcc git libkdumpfile-devel libtool make pkgconf python3 python3-devel python3-pip python3-setuptools
165
+ $ sudo dnf install autoconf automake check-devel elfutils-debuginfod-client- devel elfutils-devel gcc git libkdumpfile-devel libtool make pkgconf python3 python3-devel python3-pip python3-setuptools xz-devel
170
166
171
- * RHEL/CentOS/ Oracle Linux
167
+ * RHEL/CentOS < 9, Oracle Linux
172
168
173
169
.. code-block :: console
174
170
175
- $ sudo dnf install autoconf automake check-devel elfutils-devel gcc git libtool make pkgconf python3 python3-devel python3-pip python3-setuptools
171
+ $ sudo dnf install autoconf automake check-devel elfutils-devel gcc git libtool make pkgconf python3 python3-devel python3-pip python3-setuptools xz-devel
176
172
177
173
Optionally, install ``libkdumpfile-devel `` from EPEL on RHEL/CentOS >= 8 or
178
174
install `libkdumpfile <https://github.com/ptesarik/libkdumpfile >`_ from
@@ -191,28 +187,29 @@ First, install dependencies:
191
187
192
188
.. code-block :: console
193
189
194
- $ sudo apt install autoconf automake check gcc git liblzma-dev libelf-dev libdw-dev libtool make pkgconf python3 python3-dev python3-pip python3-setuptools zlib1g-dev
190
+ $ sudo apt install autoconf automake check gcc git libdebuginfod-dev libkdumpfile-dev liblzma-dev libelf-dev libdw-dev libtool make pkgconf python3 python3-dev python3-pip python3-setuptools zlib1g-dev
195
191
196
- Optionally, install libkdumpfile from source if you want support for the
197
- makedumpfile format.
192
+ On Debian <= 11 (Bullseye) and Ubuntu <= 22.04 (Jammy Jellyfish),
193
+ ``libkdumpfile-dev `` is not available, so you must install libkdumpfile from
194
+ source if you want support for the makedumpfile format.
198
195
199
196
* Arch Linux
200
197
201
198
.. code-block :: console
202
199
203
- $ sudo pacman -S --needed autoconf automake check gcc git libelf libkdumpfile libtool make pkgconf python python-pip python-setuptools
200
+ $ sudo pacman -S --needed autoconf automake check gcc git libelf libkdumpfile libtool make pkgconf python python-pip python-setuptools xz
204
201
205
202
* Gentoo
206
203
207
204
.. code-block :: console
208
205
209
- $ sudo emerge --noreplace --oneshot dev-build/autoconf dev-build/automake dev-libs/check dev-libs/elfutils sys-devel/gcc dev-vcs/git dev-libs/libkdumpfile dev-build/libtool dev-build/make dev-python/pip virtual/pkgconfig dev-lang/python dev-python/setuptools
206
+ $ sudo emerge --noreplace --oneshot dev-build/autoconf dev-build/automake dev-libs/check dev-libs/elfutils sys-devel/gcc dev-vcs/git dev-libs/libkdumpfile dev-build/libtool dev-build/make dev-python/pip virtual/pkgconfig dev-lang/python dev-python/setuptools app-arch/xz-utils
210
207
211
208
* openSUSE
212
209
213
210
.. code-block :: console
214
211
215
- $ sudo zypper install autoconf automake check-devel gcc git libdw-devel libelf-devel libkdumpfile-devel libtool make pkgconf python3 python3-devel python3-pip python3-setuptools
212
+ $ sudo zypper install autoconf automake check-devel gcc git libdebuginfod-devel libdw-devel libelf-devel libkdumpfile-devel libtool make pkgconf python3 python3-devel python3-pip python3-setuptools xz-devel
216
213
217
214
Then, run:
218
215
@@ -233,20 +230,20 @@ Quick Start
233
230
234
231
.. start-quick-start
235
232
236
- drgn debugs the running kernel by default; run ``sudo drgn ``. To debug a
237
- running program, run ``sudo drgn -p $PID ``. To debug a core dump (either a
238
- kernel vmcore or a userspace core dump), run ``drgn -c $PATH ``. Make sure to
239
- ` install debugging symbols
233
+ drgn debugs the running kernel by default; simply run ``drgn ``. To debug a
234
+ running program, run ``drgn -p $PID ``. To debug a core dump (either a kernel
235
+ vmcore or a userspace core dump), run ``drgn -c $PATH ``. Make sure to ` install
236
+ debugging symbols
240
237
<https://drgn.readthedocs.io/en/latest/getting_debugging_symbols.html> `_ for
241
238
whatever you are debugging.
242
239
243
- Then, you can access variables in the program with ``prog[' name' ] `` and access
240
+ Then, you can access variables in the program with ``prog[" name" ] `` and access
244
241
structure members with ``. ``:
245
242
246
243
.. code-block :: pycon
247
244
248
- $ sudo drgn
249
- >>> prog[' init_task' ].comm
245
+ $ drgn
246
+ >>> prog[" init_task" ].comm
250
247
(char [16])"swapper/0"
251
248
252
249
You can use various predefined helpers:
@@ -260,14 +257,14 @@ You can use various predefined helpers:
260
257
[b'findmnt', b'-p']
261
258
262
259
You can get stack traces with ``stack_trace() `` and access parameters or local
263
- variables with ``trace[' name' ] ``:
260
+ variables with ``trace[" name" ] ``:
264
261
265
262
.. code-block :: pycon
266
263
267
264
>>> trace = stack_trace(task)
268
265
>>> trace[5]
269
266
#5 at 0xffffffff8a5a32d0 (do_sys_poll+0x400/0x578) in do_poll at ./fs/select.c:961:8 (inlined)
270
- >>> poll_list = trace[5][' list' ]
267
+ >>> poll_list = trace[5][" list" ]
271
268
>>> file = fget(task, poll_list.entries[0].fd)
272
269
>>> d_path(file.f_path.address_of_())
273
270
b'/proc/115/mountinfo'
0 commit comments