Skip to content

Commit 27c9f93

Browse files
committed
Merge remote-tracking branch 'origin/upstreams/develop' into develop
2 parents 3bd539f + 479c283 commit 27c9f93

File tree

170 files changed

+25970
-5302
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+25970
-5302
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,12 @@ concurrency:
3535

3636
jobs:
3737
test:
38-
# We're stuck on Ubuntu 20.04 as long as we want to keep testing on Python
39-
# 3.6 due to actions/setup-python#544.
40-
runs-on: ubuntu-20.04
38+
runs-on: ubuntu-22.04
4139
strategy:
4240
matrix:
4341
python-version: ${{ (github.event_name == 'push' || inputs.test_all_python_versions)
44-
&& fromJSON('["3.13", "3.12", "3.11", "3.10", "3.9", "3.8", "3.7", "3.6"]')
45-
|| fromJSON('["3.12", "3.6"]')}}
42+
&& fromJSON('["3.13", "3.12", "3.11", "3.10", "3.9", "3.8"]')
43+
|| fromJSON('["3.13", "3.8"]')}}
4644
cc: [gcc, clang]
4745
fail-fast: false
4846
env:
@@ -55,21 +53,18 @@ jobs:
5553
with:
5654
python-version: ${{ matrix.python-version }}
5755
allow-prereleases: true
58-
- name: Check Python version for pre-commit
59-
# Only run pre-commit / mypy on upstream supported Python versions
60-
run: |
61-
if [[ "${{ matrix.python-version }}" =~ ^3\.([89]|[0-9][0-9])$ ]]; then
62-
echo USE_PRE_COMMIT=1 >> $GITHUB_ENV
63-
fi
6456
- name: Install dependencies
6557
run: |
6658
sudo apt-get update -y
6759
sudo apt-get install -y btrfs-progs check dwarves libelf-dev libdw-dev qemu-kvm zstd ${{ matrix.cc == 'clang' && 'libomp-$(clang --version | sed -rn "s/.*clang version ([0-9]+).*/\\1/p")-dev' || '' }}
68-
pip install pyroute2 setuptools ${USE_PRE_COMMIT/1/pre-commit}
60+
# pyroute2 0.9.1 dropped support for Python < 3.9.
61+
if [[ "${{ matrix.python-version }}" =~ ^3\.[678]$ ]]; then
62+
pyroute2_version="<0.9.1"
63+
fi
64+
pip install "pyroute2$pyroute2_version" setuptools pre-commit
6965
- name: Generate version.py
7066
run: python setup.py --version
7167
- name: Check with mypy
72-
if: ${{ env.USE_PRE_COMMIT == '1' }}
7368
run: pre-commit run --all-files mypy
7469
- name: Build and test with ${{ matrix.cc }}
7570
run: CONFIGURE_FLAGS="--enable-compiler-warnings=error" python setup.py test -K ${{ inputs.test_all_kernel_flavors && '-F' || '' }}

.github/workflows/dco-check.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,22 @@ jobs:
1818
git init
1919
git fetch --filter=blob:none "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" "$GITHUB_BASE_REF" "$GITHUB_REF"
2020
- name: Check for DCO sign-offs
21+
shell: bash
2122
run: |
22-
no_sign_off="$(git log --no-merges --grep=Signed-off-by --invert-grep "FETCH_HEAD..$GITHUB_SHA")"
23-
if [ -z "$no_sign_off" ]; then
23+
status=0
24+
while read -r commit; do
25+
author="$(git show --no-patch --pretty='format:%an <%ae>' "$commit")"
26+
if ! git show --no-patch --pretty='format:%(trailers:key=Signed-off-by,valueonly)' "$commit" | grep -Fxq "$author"; then
27+
if [ $status -eq 0 ]; then
28+
echo "The following commits are missing a Developer Certificate of Origin sign-off;"
29+
echo "see https://github.com/osandov/drgn/blob/main/CONTRIBUTING.rst#signing-off"
30+
echo
31+
fi
32+
status=1
33+
git show --no-patch "$commit"
34+
fi
35+
done < <(git rev-list --no-merges "FETCH_HEAD..$GITHUB_SHA")
36+
if [ $status -eq 0 ]; then
2437
echo "All commits have a Developer Certificate of Origin sign-off"
25-
else
26-
echo "The following commits are missing a Developer Certificate of Origin sign-off;"
27-
echo "see https://github.com/osandov/drgn/blob/main/CONTRIBUTING.rst#signing-off"
28-
echo
29-
echo "$no_sign_off"
30-
exit 1
3138
fi
39+
exit $status

.github/workflows/vmtest-build.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ jobs:
1313
arch: [x86_64, aarch64, ppc64, s390x, arm]
1414
fail-fast: false
1515
max-parallel: 5
16-
# Build on 20.04 so that we don't get host binaries (e.g., objtool) that
17-
# depend on libraries too new for other distros.
18-
runs-on: ubuntu-20.04
16+
runs-on: ubuntu-22.04
1917
permissions:
2018
contents: write
2119
env:

.readthedocs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ build:
33
os: ubuntu-22.04
44
tools:
55
python: "3"
6+
apt_packages:
7+
- graphviz
68
sphinx:
79
configuration: docs/conf.py
810
python:

README.rst

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,17 @@ Package Manager
6666

6767
drgn can be installed using the package manager on some Linux distributions.
6868

69-
.. image:: https://repology.org/badge/vertical-allrepos/drgn.svg
69+
.. image:: https://repology.org/badge/vertical-allrepos/drgn.svg?exclude_unsupported=1
7070
:target: https://repology.org/project/drgn/versions
7171
:alt: Packaging Status
7272

73-
* Fedora >= 32
73+
* Fedora, RHEL/CentOS Stream >= 9
7474

7575
.. code-block:: console
7676
7777
$ sudo dnf install drgn
7878
79-
* RHEL/CentOS >= 8
79+
* RHEL/CentOS < 9
8080

8181
`Enable EPEL <https://docs.fedoraproject.org/en-US/epel/#_quickstart>`_. Then:
8282

@@ -86,32 +86,35 @@ drgn can be installed using the package manager on some Linux distributions.
8686
8787
* Oracle Linux >= 8
8888

89-
Enable the ``ol8_addons`` or ``ol9_addons`` repository and install drgn:
89+
Enable the ``ol8_addons`` or ``ol9_addons`` repository. Then:
9090

9191
.. code-block:: console
9292
9393
$ sudo dnf config-manager --enable ol8_addons # OR: ol9_addons
9494
$ sudo dnf install drgn
9595
96-
Drgn is also available for Python versions in application streams. For
96+
drgn is also available for Python versions in application streams. For
9797
example, use ``dnf install python3.12-drgn`` to install drgn for Python 3.12.
9898
See the documentation for drgn in `Oracle Linux 9
9999
<https://docs.oracle.com/en/operating-systems/oracle-linux/9/drgn/how_to_install_drgn.html>`_
100100
and `Oracle Linux 8
101101
<https://docs.oracle.com/en/operating-systems/oracle-linux/8/drgn/how_to_install_drgn.html>`_
102102
for more information.
103103

104-
* Arch Linux
104+
* Debian >= 12 (Bookworm)/Ubuntu >= 24.04 (Noble Numbat)
105105

106106
.. code-block:: console
107107
108-
$ sudo pacman -S drgn
108+
$ sudo apt install python3-drgn
109109
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
111114

112115
.. code-block:: console
113116
114-
$ sudo apt install python3-drgn
117+
$ sudo pacman -S drgn
115118
116119
* Gentoo
117120

@@ -125,15 +128,6 @@ drgn can be installed using the package manager on some Linux distributions.
125128
126129
$ sudo zypper install python3-drgn
127130
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-
137131
pip
138132
^^^
139133

@@ -156,19 +150,21 @@ Note that RHEL/CentOS 6, Debian Stretch, Ubuntu Trusty, and Ubuntu Xenial (and
156150
older) ship Python versions which are too old. Python 3.6 or newer must be
157151
installed.
158152

153+
.. _installation-from-source:
154+
159155
From Source
160156
^^^^^^^^^^^
161157

162158
To get the development version of drgn, you will need to build it from source.
163159
First, install dependencies:
164160

165-
* Fedora
161+
* Fedora, RHEL/CentOS Stream >= 9
166162

167163
.. code-block:: console
168164
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
170166
171-
* RHEL/CentOS/Oracle Linux
167+
* RHEL/CentOS < 9, Oracle Linux
172168

173169
.. code-block:: console
174170
@@ -191,10 +187,11 @@ First, install dependencies:
191187

192188
.. code-block:: console
193189
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
195191
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.
198195

199196
* Arch Linux
200197

@@ -212,7 +209,7 @@ First, install dependencies:
212209

213210
.. code-block:: console
214211
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
216213
217214
Then, run:
218215

@@ -233,20 +230,20 @@ Quick Start
233230

234231
.. start-quick-start
235232
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
240237
<https://drgn.readthedocs.io/en/latest/getting_debugging_symbols.html>`_ for
241238
whatever you are debugging.
242239

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
244241
structure members with ``.``:
245242

246243
.. code-block:: pycon
247244
248-
$ sudo drgn
249-
>>> prog['init_task'].comm
245+
$ drgn
246+
>>> prog["init_task"].comm
250247
(char [16])"swapper/0"
251248
252249
You can use various predefined helpers:
@@ -260,14 +257,14 @@ You can use various predefined helpers:
260257
[b'findmnt', b'-p']
261258
262259
You can get stack traces with ``stack_trace()`` and access parameters or local
263-
variables with ``trace['name']``:
260+
variables with ``trace["name"]``:
264261

265262
.. code-block:: pycon
266263
267264
>>> trace = stack_trace(task)
268265
>>> trace[5]
269266
#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"]
271268
>>> file = fget(task, poll_list.entries[0].fd)
272269
>>> d_path(file.f_path.address_of_())
273270
b'/proc/115/mountinfo'

0 commit comments

Comments
 (0)