Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ jobs:
strategy:
matrix:
python-version: [3.9, 3.8, 3.7, 3.6]
cc: [gcc, clang]
fail-fast: false
env:
CC: ${{ matrix.cc }}
CFLAGS: -Wall -Werror -g -O2
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -18,14 +22,14 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install busybox-static libelf-dev libdw-dev qemu-kvm zstd
sudo apt-get install busybox-static libelf-dev libdw-dev qemu-kvm zstd ${{ matrix.cc == 'clang' && 'libomp-dev' || '' }}
pip install mypy
- name: Generate version.py
run: python setup.py --version
- name: Check with mypy
run: mypy --strict --no-warn-return-any drgn _drgn.pyi
- name: Build and test
run: python setup.py test -K
- name: Build and test with ${{ matrix.cc }}
run: python setup.py test

lint:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
recursive-include docs *.py *.rst
recursive-include docs *.css *.ico *.png *.py *.rst
recursive-include examples *.py
recursive-include tests *.py
recursive-include tools *.py
Expand Down
2 changes: 1 addition & 1 deletion _drgn.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
libdrgn bindings
Expand Down
2 changes: 1 addition & 1 deletion docs/exts/drgndoc/docstrings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

import argparse
import functools
Expand Down
2 changes: 1 addition & 1 deletion docs/exts/drgndoc/ext.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
drgn consists of a core C extension and supporting Python code. It also makes
Expand Down
2 changes: 1 addition & 1 deletion docs/exts/drgndoc/format.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

import ast
import re
Expand Down
2 changes: 1 addition & 1 deletion docs/exts/drgndoc/namespace.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

import itertools
from typing import Generic, Iterator, List, Mapping, Optional, Sequence, TypeVar, Union
Expand Down
2 changes: 1 addition & 1 deletion docs/exts/drgndoc/parse.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

import ast
import inspect
Expand Down
2 changes: 1 addition & 1 deletion docs/exts/drgndoc/util.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

from typing import Optional

Expand Down
2 changes: 1 addition & 1 deletion docs/exts/drgndoc/visitor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

import ast
import sys
Expand Down
2 changes: 1 addition & 1 deletion drgn/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
Scriptable debugger library
Expand Down
2 changes: 1 addition & 1 deletion drgn/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
drgn entry point
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
Helpers
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
Linux Kernel
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/block.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
Block Layer
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/boot.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
Boot
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/bpf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
BPF
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/cgroup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
Cgroup
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/cpumask.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
CPU Masks
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/device.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
Devices
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/fs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
Virtual Filesystem Layer
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/idr.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
IDR
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/kconfig.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
Kconfig
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/kernfs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
Kernfs
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/list.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
Linked Lists
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/list_nulls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
Nulls Lists
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/mm.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
Memory Management
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/net.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
Networking
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/percpu.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
Per-CPU
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/pid.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
Process IDS
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/radixtree.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
Radix Trees
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/rbtree.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
Red-Black Trees
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/sched.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
CPU Scheduler
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/tcp.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
TCP
Expand Down
2 changes: 1 addition & 1 deletion drgn/helpers/linux/user.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
Users
Expand Down
2 changes: 1 addition & 1 deletion drgn/internal/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""
drgn internals
Expand Down
2 changes: 1 addition & 1 deletion drgn/internal/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""drgn command line interface"""

Expand Down
2 changes: 1 addition & 1 deletion drgn/internal/rlcompleter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""Improved readline completer"""

Expand Down
2 changes: 1 addition & 1 deletion examples/linux/cgroup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""List the paths of all descendants of a cgroup v2"""

Expand Down
2 changes: 1 addition & 1 deletion examples/linux/fs_inodes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""List the paths of all inodes cached in a given filesystem"""

Expand Down
2 changes: 1 addition & 1 deletion examples/linux/lsmod.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""An implementation of lsmod(8) using drgn"""

Expand Down
2 changes: 1 addition & 1 deletion examples/linux/ps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""A simplified implementation of ps(1) using drgn"""

Expand Down
2 changes: 1 addition & 1 deletion examples/linux/tcp_sock.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

"""List all TCP sockets and their cgroup v2 paths"""

Expand Down
8 changes: 1 addition & 7 deletions libdrgn/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# SPDX-License-Identifier: GPL-3.0+
# SPDX-License-Identifier: GPL-3.0-or-later

ACLOCAL_AMFLAGS = -I m4

Expand Down Expand Up @@ -164,9 +164,3 @@ EXTRA_PROGRAMS = examples/load_debug_info

examples_load_debug_info_SOURCES = examples/load_debug_info.c
examples_load_debug_info_LDADD = libdrgnimpl.la

CLEANFILES = $(ARCH_INCS) \
drgn.h \
python/constants.c \
python/docstrings.c \
python/docstrings.h
Loading