drgn/contrib
Leon Hwang 200d870b98 contrib/bpf_inspect.py: list bpf links
Like `list_bpf_progs()` and `list_bpf_maps()`, it's easy to implement
`list_bpf_links()`.

Here's an use example:

```bash
drgn ./contrib/bpf_inspect.py l
     1: BPF_LINK_TYPE_TRACING            prog:      2: BPF_PROG_TYPE_TRACING            hid_tail_call
   931: BPF_LINK_TYPE_XDP                prog:   2056: BPF_PROG_TYPE_XDP                dummy
   932: BPF_LINK_TYPE_TRACING            prog:   2060: BPF_PROG_TYPE_TRACING            fentry_xdp
   933: BPF_LINK_TYPE_TRACING            prog:   2061: BPF_PROG_TYPE_TRACING            fexit_xdp
```

Signed-off-by: Leon Hwang <hffilwlqm@gmail.com>
2024-05-30 10:45:00 -07:00
..
bpf_inspect.py contrib/bpf_inspect.py: list bpf links 2024-05-30 10:45:00 -07:00
btrfs_orphan_subvolumes.py contrib/btrfs_orphan_subvolumes.py: handle inodes with no cached names 2023-12-11 15:38:39 -08:00
btrfs_tree_mod_log.py Add btrfs helpers to contrib 2023-06-09 09:38:26 -07:00
btrfs_tree.py contrib/btrfs_tree.py: fix extra whitespace when printing inode item 2024-05-22 09:44:36 -07:00
cgroup.py Create contrib directory 2022-11-16 13:17:50 -08:00
dm_crypt_key.py contrib: add script to recover dm-crypt encryption key 2024-01-11 15:20:19 -08:00
dump_btrfs_bgs.py contrib: add btrfs block group dumper 2023-06-14 16:36:13 -07:00
find_struct_file.py contrib/find_struct_file.py: also look in binfmt_misc 2023-10-16 10:45:45 -07:00
fs_inodes.py fs_inodes: catch proper exception for None path 2023-01-26 08:43:16 -08:00
gcore.py contrib/gcore.py: fix vma offset handling 2024-05-08 10:06:16 -07:00
irq.py contrib/irq: fix for v6.5 and later kernels. 2024-03-21 11:02:57 -07:00
kcore_list.py contrib: add kcore_list.py 2023-02-21 14:26:54 -08:00
kernel_sys.py add kernel_sys.py to contrib 2023-02-24 12:22:00 -08:00
lsmod.py contrib/lsmod.py: update for Linux 6.4 2024-05-29 16:49:35 -07:00
mount.py add mount.py contrib script 2023-01-27 09:56:57 -08:00
negdentdelete.py contrib: add negdentdelete.py script 2024-05-21 15:18:59 -07:00
platform_drivers.py contrib: add script to dump platform drivers 2023-06-20 11:11:23 -07:00
ps.py script/ps: enhanced ps script 2023-08-29 09:46:45 -07:00
ptdrgn.py Add stack_trace() shortcut function 2023-11-30 14:44:51 -08:00
README.rst Create contrib directory 2022-11-16 13:17:50 -08:00
search_kernel_memory.py contrib/search_kernel_memory.py: translate vmap addresses 2024-04-03 01:55:03 -07:00
stack_trace_call_fault.py contrib: add stack_trace_call_fault.py 2023-10-13 16:48:21 -07:00
tcp_sock.py Fix TCP listing contrib script 2023-02-24 13:15:00 -08:00
vmmap.py contrib/vmmap.py: use new for_each_vma() helper 2023-10-30 13:09:21 -07:00
vmstat.py contrib: vmstat.py: move implementation comment out of docstring 2023-02-03 11:44:04 -08:00

Community-Contributed Content
=============================

This directory contains drgn scripts, libraries, and notes that have been
contributed by the community but aren't considered a part of drgn proper. Code
in this directory is not tested and not necessarily up to the rest of the
project's standards.

This is intended as a central location to share drgn ideas with a low barrier
to entry. If you have time to polish your code, consider submitting it as a
proper helper or tool. If not, feel free to dump it here. Someone else might
find it useful as a starting point for their own investigation. It could even
be adapted into a helper or tool later.

Contributing to ``contrib``
---------------------------

The bar for contributing to ``contrib`` is intentionally low. Code submitted
here can be rough and will be only lightly reviewed. The only hard requirements
are:

* It must be relevant to drgn.
* All files must have a comment or docstring at the top describing what they
  are. This can be short.

There are also some boring legal requirements:

* All files must have a copyright notice.
* All files must be licensed under the LGPLv2.1+ (using
  ``SPDX-License-Identifier: LGPL-2.1-or-later``).
* All commits must have a ``Signed-off-by`` trailer. See `Signing Off
  <../CONTRIBUTING.rst#signing-off>`_.

We may choose to edit, reorganize, or drop parts your contribution. If in
doubt, go ahead and open a pull request, and we'll decide what to do with it.